sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 014ddd023ffcf3f5d268a4e6ba0f5198ce24f752
parent 1d844da526ade9a2c053d39d882595aee38965b5
Author: Robert <robertgeorgecode@gmail.com>
Date:   Sat,  1 Jul 2023 02:43:54 +0100

added a tag color patch to the dwm patches list on the wiki

Diffstat:
Adwm.suckless.org/patches/tagcolorscheme/bar.png | 0
Adwm.suckless.org/patches/tagcolorscheme/dwm-tagcolorscheme-6.4.diff | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/tagcolorscheme/index.md | 19+++++++++++++++++++
3 files changed, 112 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/tagcolorscheme/bar.png b/dwm.suckless.org/patches/tagcolorscheme/bar.png Binary files differ. diff --git a/dwm.suckless.org/patches/tagcolorscheme/dwm-tagcolorscheme-6.4.diff b/dwm.suckless.org/patches/tagcolorscheme/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/dwm.suckless.org/patches/tagcolorscheme/index.md b/dwm.suckless.org/patches/tagcolorscheme/index.md @@ -0,0 +1,19 @@ +tagcolorscheme +============== + +Description +----------- +This patch removes the use of box decorations to indicate used tags. +Instead different colors can be used to represent tag usage. + +![default bar](bar.png) + +Download +-------- +* [dwm-tagcolorscheme-6.4.diff](dwm-tagcolorscheme-6.4.diff) +* Github - <https://github.com/robertgeorgebyrne/dwm-tagcolorscheme> + +Authors +------- +* Robert Byrne - <robertgeorgecode@gmail.com> +