commit 9e17b34ca6f956a65aa0fc5ffee2ea37b47bcd21
Author: aboven <[email protected]>
Date:   Mon May 10 10:07:59 2021 +0200

    [dwm][patch][rainbowtags] update for dwm 6.2

diff --git 
a/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.2-alpha.diff 
b/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.2-alpha.diff
new file mode 100644
index 00000000..8701b197
--- /dev/null
+++ b/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.2-alpha.diff
@@ -0,0 +1,61 @@
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..80d0e6e 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -21,6 +21,20 @@ static const char *colors[][3]      = {
+ /* tagging */
+ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+ 
++static const char *tagsel[][2] = {
++      { "#ffffff", "#ff0000" },
++      { "#ffffff", "#ff7f00" },
++      { "#000000", "#ffff00" },
++      { "#000000", "#00ff00" },
++      { "#ffffff", "#0000ff" },
++      { "#ffffff", "#4b0082" },
++      { "#ffffff", "#9400d3" },
++      { "#000000", "#ffffff" },
++      { "#ffffff", "#000000" },
++};
++
++static const unsigned int tagalpha[] = { OPAQUE, baralpha };
++
+ static const Rule rules[] = {
+       /* xprop(1):
+        *      WM_CLASS(STRING) = instance, class
+diff --git a/dwm.c b/dwm.c
+index b0b3466..23d1c46 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;
+@@ -717,7 +718,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, (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 (occ & 1 << i)
+                       drw_rect(drw, x + boxs, boxs, boxw, boxw,
+@@ -1568,9 +1569,14 @@ setup(void)
+       cursor[CurResize] = drw_cur_create(drw, XC_sizing);
+       cursor[CurMove] = drw_cur_create(drw, XC_fleur);
+       /* init appearance */
++      if (LENGTH(tags) > LENGTH(tagsel))
++              die("too few color schemes for the tags");
+       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], tagalpha, 2);
+       /* init bars */
+       updatebars();
+       updatestatus();
diff --git a/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.2.diff 
b/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.2.diff
new file mode 100644
index 00000000..6c310622
--- /dev/null
+++ b/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.2.diff
@@ -0,0 +1,59 @@
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..3fb5cf8 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -21,6 +21,18 @@ static const char *colors[][3]      = {
+ /* tagging */
+ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+ 
++static const char *tagsel[][2] = {
++      { "#ffffff", "#ff0000" },
++      { "#ffffff", "#ff7f00" },
++      { "#000000", "#ffff00" },
++      { "#000000", "#00ff00" },
++      { "#ffffff", "#0000ff" },
++      { "#ffffff", "#4b0082" },
++      { "#ffffff", "#9400d3" },
++      { "#000000", "#ffffff" },
++      { "#ffffff", "#000000" },
++};
++
+ static const Rule rules[] = {
+       /* xprop(1):
+        *      WM_CLASS(STRING) = instance, class
+diff --git a/dwm.c b/dwm.c
+index b0b3466..c16d5f5 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;
+@@ -717,7 +718,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, (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 (occ & 1 << i)
+                       drw_rect(drw, x + boxs, boxs, boxw, boxw,
+@@ -1568,9 +1569,14 @@ setup(void)
+       cursor[CurResize] = drw_cur_create(drw, XC_sizing);
+       cursor[CurMove] = drw_cur_create(drw, XC_fleur);
+       /* init appearance */
++      if (LENGTH(tags) > LENGTH(tagsel))
++              die("too few color schemes for the tags");
+       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/rainbowtags/index.md 
b/dwm.suckless.org/patches/rainbowtags/index.md
index 5e2d6d97..f7c616ad 100644
--- a/dwm.suckless.org/patches/rainbowtags/index.md
+++ b/dwm.suckless.org/patches/rainbowtags/index.md
@@ -6,16 +6,26 @@ Description
 Allows each tag to be an independent/unique color
 when selected.
 
+Inspired by colorful 90s & 2000s software.
+
+### rainbowtags-6.1
 Two arrays of colors (tagselfg, tagselbg) are used
 for tags in place of selfgcolor and selbgcolor.
 
-Inspired by colorful 90s & 2000s software.
+### rainbowtags-6.2
+A two dimensional array for defining foreground and background color per tag.
 
 Download
 --------
 * [dwm-rainbowtags-6.1.diff](dwm-rainbowtags-6.1.diff)
+* [dwm-rainbowtags-6.2.diff](dwm-rainbowtags-6.2.diff)
+
+If using [alpha](https://dwm.suckless.org/patches/alpha/), use patch below:
+
+* [dwm-rainbowtags-6.2-alpha.diff](dwm-rainbowtags-6.2-alpha.diff)
 
 Authors
 -------
 * Jared - <[email protected]>
+* Arie Boven - <[email protected]> (update 6.2)
 


Reply via email to