From cdf9996d74fbdda51d42054a291f7f936cf1a0ec Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 30 Dec 2024 16:56:42 +0100 Subject: near perfection --- applied/dwm-tagcolorscheme-6.4.diff | 93 +++++++++++++++++++++++++++++++++++++ config.def.h | 39 ++++++++++------ dwm-tagcolorscheme-6.4.diff | 93 ------------------------------------- dwm.c | 21 +++++---- 4 files changed, 131 insertions(+), 115 deletions(-) create mode 100644 applied/dwm-tagcolorscheme-6.4.diff delete mode 100644 dwm-tagcolorscheme-6.4.diff diff --git a/applied/dwm-tagcolorscheme-6.4.diff b/applied/dwm-tagcolorscheme-6.4.diff new file mode 100644 index 0000000..1f6a7f5 --- /dev/null +++ b/applied/dwm-tagcolorscheme-6.4.diff @@ -0,0 +1,93 @@ +diff --git a/config.def.h b/config.def.h +index 061ad66..6fd24f0 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -18,6 +18,13 @@ static const char *colors[][3] = { + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, + }; + ++static const char *tagsel[][2] = { ++ /* fg bg */ ++ { col_gray3, col_gray1 }, /* norm */ ++ { col_gray4, col_cyan }, /* sel */ ++ { col_cyan, col_gray1 }, /* occ but not sel */ ++ { col_cyan, col_gray3 }, /* has pinned tag */ ++}; + /* tagging */ + static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +diff --git a/dwm.c b/dwm.c +index e5efb6a..bc7c2a8 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -264,6 +264,7 @@ static Atom wmatom[WMLast], netatom[NetLast]; + static int running = 1; + static Cur *cursor[CurLast]; + static Clr **scheme; ++static Clr **tagscheme; + static Display *dpy; + static Drw *drw; + static Monitor *mons, *selmon; +@@ -487,9 +488,12 @@ cleanup(void) + cleanupmon(mons); + for (i = 0; i < CurLast; i++) + drw_cur_free(drw, cursor[i]); +- for (i = 0; i < LENGTH(colors); i++) +- free(scheme[i]); ++ for (i = 0; i < LENGTH(colors); i++) ++ free(scheme[i]); ++ for (i = 0; i < LENGTH(tagsel); i++) ++ free(tagscheme[i]); + free(scheme); ++ free(tagscheme); + XDestroyWindow(dpy, wmcheckwin); + drw_free(drw); + XSync(dpy, False); +@@ -721,16 +725,19 @@ drawbar(Monitor *m) + urg |= c->tags; + } + 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_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, +- m == selmon && selmon->sel && selmon->sel->tags & 1 << i, +- urg & 1 << i); +- x += w; +- } ++ for (i = 0; i < LENGTH(tags); i++) { ++ w = TEXTW(tags[i]); ++ if (m->tagset[m->seltags] & 1 << i) ++ drw_setscheme(drw, tagscheme[1]); ++ else if (m == selmon && selmon->sel && selmon->sel->tags & 1 << i) ++ drw_setscheme(drw, tagscheme[3]); ++ else if (occ & 1 << i) ++ drw_setscheme(drw, tagscheme[2]); ++ else ++ drw_setscheme(drw, tagscheme[0]); ++ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); ++ x += w; ++ } + w = TEXTW(m->ltsymbol); + drw_setscheme(drw, scheme[SchemeNorm]); + x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); +@@ -1526,7 +1533,6 @@ setmfact(const Arg *arg) + selmon->mfact = f; + arrange(selmon); + } +- + void + setup(void) + { +@@ -1571,6 +1577,9 @@ setup(void) + scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); + for (i = 0; i < LENGTH(colors); i++) + scheme[i] = drw_scm_create(drw, colors[i], 3); ++ tagscheme = ecalloc(LENGTH(tagsel), sizeof(Clr *)); ++ for (i = 0; i < LENGTH(tagsel); i++) ++ tagscheme[i] = drw_scm_create(drw, tagsel[i], 2); + /* init bars */ + updatebars(); + updatestatus(); diff --git a/config.def.h b/config.def.h index 37d48a9..52733e7 100644 --- a/config.def.h +++ b/config.def.h @@ -12,9 +12,9 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display static const int showsystray = 1; /* 0 means no systray */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static const int user_bh = 24; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ +static const int user_bh = 30; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ static const int focusonwheel = 0; -static const char *fonts[] = { "BigBlueTermPlus Nerd Font:size=12" }; +static const char *fonts[] = { "BigBlueTermPlus Nerd Font:size=15" }; // static const char *fonts[] = { "Terminess Nerd Font:style=Bold:size=13" }; // static const char *fonts[] = { "GohuFont 11 Nerd Font:size=13" }; static const char dmenufont[] = "monospace:size=11"; @@ -22,7 +22,7 @@ static const char col_gray1[] = "#1d2021"; /* bar background */ static const char col_gray2[] = "#32302f"; /* last square, windows borders */ static const char col_gray3[] = "#ebdbb2"; /* squares bg, maybe text */ static const char col_gray4[] = "#ebdbb2"; /* selected square */ -static const char col_cyan[] = "#900000"; /* red tint */ +static const char col_cyan[] = "#9d0006"; /* red tint */ static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, @@ -50,10 +50,20 @@ static Sp scratchpads[] = { }; /* tagging */ -static const char *tags[] = { "  ", "  ", "  ", " 󰈹 ", " 󰍹 ", "  ", "  ", "  ", "  " }; +static const char *tags[] = { + "  ", + "  ", + "  ", + "  ", + "  ", + "  ", + "  ", + "  ", + "  " +}; static const unsigned int ulinepad = 6; /* horizontal padding between the underline and tag */ -static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ +static const unsigned int ulinestroke = 3; /* thickness / height of the underline */ static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ @@ -71,15 +81,16 @@ static const char *tagsel[][3] = { // { "#928374", "#1d2021", "" }, // gray // { "#ebdbb2", "#1d2021", "" }, // white // gruvbox dark - { "#cc241d", "#1d2021", "#928374" }, // red - { "#98971a", "#1d2021", "#928374" }, // green - { "#d79921", "#1d2021", "#928374" }, // yellow - { "#458588", "#1d2021", "#928374" }, // blue - { "#b16286", "#1d2021", "#928374" }, // magenta - { "#8ec07c", "#1d2021", "#928374" }, // cyan - { "#d65d0e", "#1d2021", "#928374" }, // orange - { "#928374", "#1d2021", "#928374" }, // gray - { "#ebdbb2", "#1d2021", "#928374" }, // white + { "#cc241d", "#1d2021" }, // red + { "#d65d0e", "#1d2021" }, // orange + { "#d79921", "#1d2021" }, // yellow + { "#458588", "#1d2021" }, // blue + { "#8ec07c", "#1d2021" }, // cyan + { "#98971a", "#1d2021" }, // green + { "#b16286", "#1d2021" }, // magenta + { "#fe8019", "#1d2021" }, // re orange + { "#ebdbb2", "#1d2021" }, // white + { "#7c6f64", "#1d2021" }, // empty }; static const Rule rules[] = { diff --git a/dwm-tagcolorscheme-6.4.diff b/dwm-tagcolorscheme-6.4.diff deleted file mode 100644 index 1f6a7f5..0000000 --- a/dwm-tagcolorscheme-6.4.diff +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 061ad66..6fd24f0 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -18,6 +18,13 @@ static const char *colors[][3] = { - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, - }; - -+static const char *tagsel[][2] = { -+ /* fg bg */ -+ { col_gray3, col_gray1 }, /* norm */ -+ { col_gray4, col_cyan }, /* sel */ -+ { col_cyan, col_gray1 }, /* occ but not sel */ -+ { col_cyan, col_gray3 }, /* has pinned tag */ -+}; - /* tagging */ - static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -diff --git a/dwm.c b/dwm.c -index e5efb6a..bc7c2a8 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -264,6 +264,7 @@ static Atom wmatom[WMLast], netatom[NetLast]; - static int running = 1; - static Cur *cursor[CurLast]; - static Clr **scheme; -+static Clr **tagscheme; - static Display *dpy; - static Drw *drw; - static Monitor *mons, *selmon; -@@ -487,9 +488,12 @@ cleanup(void) - cleanupmon(mons); - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); -- for (i = 0; i < LENGTH(colors); i++) -- free(scheme[i]); -+ for (i = 0; i < LENGTH(colors); i++) -+ free(scheme[i]); -+ for (i = 0; i < LENGTH(tagsel); i++) -+ free(tagscheme[i]); - free(scheme); -+ free(tagscheme); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); -@@ -721,16 +725,19 @@ drawbar(Monitor *m) - urg |= c->tags; - } - 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_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, -- m == selmon && selmon->sel && selmon->sel->tags & 1 << i, -- urg & 1 << i); -- x += w; -- } -+ for (i = 0; i < LENGTH(tags); i++) { -+ w = TEXTW(tags[i]); -+ if (m->tagset[m->seltags] & 1 << i) -+ drw_setscheme(drw, tagscheme[1]); -+ else if (m == selmon && selmon->sel && selmon->sel->tags & 1 << i) -+ drw_setscheme(drw, tagscheme[3]); -+ else if (occ & 1 << i) -+ drw_setscheme(drw, tagscheme[2]); -+ else -+ drw_setscheme(drw, tagscheme[0]); -+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); -+ x += w; -+ } - w = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); -@@ -1526,7 +1533,6 @@ setmfact(const Arg *arg) - selmon->mfact = f; - arrange(selmon); - } -- - void - setup(void) - { -@@ -1571,6 +1577,9 @@ setup(void) - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); -+ tagscheme = ecalloc(LENGTH(tagsel), sizeof(Clr *)); -+ for (i = 0; i < LENGTH(tagsel); i++) -+ tagscheme[i] = drw_scm_create(drw, tagsel[i], 2); - /* init bars */ - updatebars(); - updatestatus(); diff --git a/dwm.c b/dwm.c index bfb7ba2..9b610a2 100644 --- a/dwm.c +++ b/dwm.c @@ -1129,15 +1129,16 @@ void drawbar(Monitor *m) { int x, w, tw = 0, stw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; + // int boxs = drw->fonts->h / 9; + // int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; Client *c; if (!m->showbar) return; - if(showsystray && m == systraytomon(m) && !systrayonleft) + // if(showsystray && m == systraytomon(m) && !systrayonleft) + if(showsystray && !systrayonleft) stw = getsystraywidth(); /* draw status first so it can be overdrawn by tags later */ @@ -1154,14 +1155,18 @@ drawbar(Monitor *m) x = 0; for (i = 0; i < LENGTH(tags); i++) { w = TEXTW(tags[i]); - drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeNorm])); + if (occ & 1 << i) + drw_setscheme(drw, tagscheme[i]); + else + drw_setscheme(drw, tagscheme[9]); + // drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeNorm])); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); if (ulineall || m->tagset[m->seltags] & 1 << i) /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */ drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); + // if (occ & 1 << i) + // drw_rect(drw, x + boxs, boxs, boxw, boxw, + // m == selmon && selmon->sel && selmon->sel->tags & 1 << i, + // urg & 1 << i); x += w; } w = TEXTW(m->ltsymbol); -- cgit v1.2.3