[wiki] [sites] added a tag color patch to the dwm patches list on the wiki || Robert

From: <git_AT_suckless.org>
Date: Sat, 01 Jul 2023 03:44:12 +0200

commit 014ddd023ffcf3f5d268a4e6ba0f5198ce24f752
Author: Robert <robertgeorgecode_AT_gmail.com>
Date: Sat Jul 1 02:43:54 2023 +0100

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

diff --git a/dwm.suckless.org/patches/tagcolorscheme/bar.png b/dwm.suckless.org/patches/tagcolorscheme/bar.png
new file mode 100644
index 00000000..7de64ca3
Binary files /dev/null and b/dwm.suckless.org/patches/tagcolorscheme/bar.png 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
new file mode 100644
index 00000000..1f6a7f58
--- /dev/null
+++ b/dwm.suckless.org/patches/tagcolorscheme/dwm-tagcolorscheme-6.4.diff
_AT_@ -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
+_AT_@ -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
+_AT_@ -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;
+_AT_@ -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);
+_AT_@ -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);
+_AT_@ -1526,7 +1533,6 @@ setmfact(const Arg *arg)
+ selmon->mfact = f;
+ arrange(selmon);
+ }
+-
+ void
+ setup(void)
+ {
+_AT_@ -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
new file mode 100644
index 00000000..4e6f80fa
--- /dev/null
+++ b/dwm.suckless.org/patches/tagcolorscheme/index.md
_AT_@ -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_AT_gmail.com>
+
Received on Sat Jul 01 2023 - 03:44:12 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 01 2023 - 03:48:53 CEST