From fc6af967107f1da473602afda401d78bb2ab67b1 Mon Sep 17 00:00:00 2001 From: hippoz Date: Sat, 19 Dec 2020 14:54:26 +0200 Subject: [PATCH] Start of rice --- README | 6 ++++ config.def.h | 55 +++++++++++++++++++++++++++------- dwm-colorbar-6.2.diff | 68 +++++++++++++++++++++++++++++++++++++++++++ dwm.c | 12 ++++---- test.sh | 10 +++++++ 5 files changed, 135 insertions(+), 16 deletions(-) create mode 100644 dwm-colorbar-6.2.diff create mode 100755 test.sh diff --git a/README b/README index 95d4fd0..81a2322 100644 --- a/README +++ b/README @@ -46,3 +46,9 @@ Configuration ------------- The configuration of dwm is done by creating a custom config.h and (re)compiling the source code. + +Rice-specific info +------------------ +This is a custom rice. +I have modified the config and also added the following patches: + - dwm-colorbar (https://dwm.suckless.org/patches/colorbar/) \ No newline at end of file diff --git a/config.def.h b/config.def.h index a89f8b2..ac6ab90 100644 --- a/config.def.h +++ b/config.def.h @@ -1,27 +1,62 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int borderpx = 3; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ static const char *fonts[] = { "monospace:size=12", "fontawesome:size=12" }; static const char dmenufont[] = "monospace:size=12"; -// bg -static const char col_gray1[] = "#121212"; -// inactive border + +static const char col_gray1[] = "#222222"; static const char col_gray2[] = "#444444"; -// font static const char col_gray3[] = "#bbbbbb"; -// current tag and current window static const char col_gray4[] = "#eeeeee"; -// top bar 2nd color and active window border color -static const char col_cyan[] = "#370045"; +static const char col_cyan[] = "#005577"; + +// !! TO SEE THE COLORS, PLEASE REFER TO https://www.nordtheme.com/docs/colors-and-palettes + +// Polar Night +static const char col_nord0[] = "#2e3440"; +static const char col_nord1[] = "#3b4252"; +static const char col_nord2[] = "#434c5e"; +static const char col_nord3[] = "#4c566a"; + +// Snow Storm +static const char col_nord4[] = "#d8dee9"; +static const char col_nord5[] = "#e5e9f0"; +static const char col_nord6[] = "#eceff4"; + +// Frost + +static const char col_nord7[] = "#8fbcbb"; +static const char col_nord8[] = "#88c0d0"; +static const char col_nord9[] = "#81a1c1"; +static const char col_nord10[] = "#5e81ac"; + +// Aurora + +static const char col_nord11[] = "#bf616a"; +static const char col_nord12[] = "#d08770"; +static const char col_nord13[] = "#ebcb8b"; +static const char col_nord14[] = "#a3be8c"; +static const char col_nord15[] = "#b48ead"; + +static const char col_nord15_light[] = "#8e5783"; static const char *colors[][3] = { /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, + [SchemeNorm] = { col_nord5, col_nord0, col_gray2 }, + [SchemeSel] = { col_nord6, col_nord15_light, col_nord15_light }, + + // text, bg, unused + [SchemeStatus] = { col_nord5, col_nord15, "#000000" }, // Statusbar right + + [SchemeTagsSel] = { col_nord6, col_nord15, "#000000" }, // Tagbar left selected + [SchemeTagsNorm] = { col_nord5, col_nord0, "#000000" }, // Tagbar left unselected + + [SchemeInfoSel] = { col_nord6, col_nord15_light, "#000000" }, // infobar middle selected + [SchemeInfoNorm] = { col_nord5, col_nord0, "#000000" }, // infobar middle unselected }; /* tagging */ diff --git a/dwm-colorbar-6.2.diff b/dwm-colorbar-6.2.diff new file mode 100644 index 0000000..91c067d --- /dev/null +++ b/dwm-colorbar-6.2.diff @@ -0,0 +1,68 @@ +diff --git a/config.def.h b/config.def.h +index 1c0b587..a516645 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -16,6 +16,11 @@ static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, ++ [SchemeStatus] = { col_gray3, col_gray1, "#000000" }, // Statusbar right {text,background,not used but cannot be empty} ++ [SchemeTagsSel] = { col_gray4, col_cyan, "#000000" }, // Tagbar left selected {text,background,not used but cannot be empty} ++ [SchemeTagsNorm] = { col_gray3, col_gray1, "#000000" }, // Tagbar left unselected {text,background,not used but cannot be empty} ++ [SchemeInfoSel] = { col_gray4, col_cyan, "#000000" }, // infobar middle selected {text,background,not used but cannot be empty} ++ [SchemeInfoNorm] = { col_gray3, col_gray1, "#000000" }, // infobar middle unselected {text,background,not used but cannot be empty} + }; + + /* tagging */ +diff --git a/dwm.c b/dwm.c +index 4465af1..0d1d2f7 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -59,7 +59,7 @@ + + /* enums */ + enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ +-enum { SchemeNorm, SchemeSel }; /* color schemes */ ++enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */ + enum { NetSupported, NetWMName, NetWMState, NetWMCheck, + NetWMFullscreen, NetActiveWindow, NetWMWindowType, + NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ +@@ -703,7 +703,7 @@ drawbar(Monitor *m) + + /* draw status first so it can be overdrawn by tags later */ + if (m == selmon) { /* status is only drawn on selected monitor */ +- drw_setscheme(drw, scheme[SchemeNorm]); ++ drw_setscheme(drw, scheme[SchemeStatus]); + sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ + drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); + } +@@ -716,7 +716,7 @@ drawbar(Monitor *m) + x = 0; + for (i = 0; i < LENGTH(tags); i++) { + w = TEXTW(tags[i]); +- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); ++ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]); + drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); + if (occ & 1 << i) + drw_rect(drw, x + boxs, boxs, boxw, boxw, +@@ -725,17 +725,17 @@ drawbar(Monitor *m) + x += w; + } + w = blw = TEXTW(m->ltsymbol); +- drw_setscheme(drw, scheme[SchemeNorm]); ++ drw_setscheme(drw, scheme[SchemeTagsNorm]); + x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); + + if ((w = m->ww - sw - x) > bh) { + if (m->sel) { +- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); ++ drw_setscheme(drw, scheme[m == selmon ? SchemeInfoSel : SchemeInfoNorm]); + drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); + if (m->sel->isfloating) + drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); + } else { +- drw_setscheme(drw, scheme[SchemeNorm]); ++ drw_setscheme(drw, scheme[SchemeInfoNorm]); + drw_rect(drw, x, 0, w, bh, 1, 1); + } + } diff --git a/dwm.c b/dwm.c index 4465af1..0d1d2f7 100644 --- a/dwm.c +++ b/dwm.c @@ -59,7 +59,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ +enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -703,7 +703,7 @@ drawbar(Monitor *m) /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ - drw_setscheme(drw, scheme[SchemeNorm]); + drw_setscheme(drw, scheme[SchemeStatus]); sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); } @@ -716,7 +716,7 @@ drawbar(Monitor *m) x = 0; for (i = 0; i < LENGTH(tags); i++) { w = TEXTW(tags[i]); - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); + drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); if (occ & 1 << i) drw_rect(drw, x + boxs, boxs, boxw, boxw, @@ -725,17 +725,17 @@ drawbar(Monitor *m) x += w; } w = blw = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); + drw_setscheme(drw, scheme[SchemeTagsNorm]); x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); if ((w = m->ww - sw - x) > bh) { if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); + drw_setscheme(drw, scheme[m == selmon ? SchemeInfoSel : SchemeInfoNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); if (m->sel->isfloating) drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); } else { - drw_setscheme(drw, scheme[SchemeNorm]); + drw_setscheme(drw, scheme[SchemeInfoNorm]); drw_rect(drw, x, 0, w, bh, 1, 1); } } diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..6123413 --- /dev/null +++ b/test.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# This script is a dirty hack, just so I can test my config quicky. + +rm config.h +make + +Xephyr -br -ac -noreset -screen 800x600 :1 & +sleep 0.6 +DISPLAY=:1 ./dwm & \ No newline at end of file