[wiki] [sites] [dwm][rainbowtags] create rainbowtags patch || Jared

From: <git_AT_suckless.org>
Date: Fri, 26 Feb 2021 09:54:03 +0100

commit 19282f498615cd6aa27a1586f554fd23b0d63326
Author: Jared <7060603_AT_hotmail.ca>
Date: Fri Feb 26 03:53:47 2021 -0500

    [dwm][rainbowtags] create rainbowtags patch
    
    A unique selected tag color per tag

diff --git a/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.1.diff b/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.1.diff
new file mode 100644
index 00000000..744aed21
--- /dev/null
+++ b/dwm.suckless.org/patches/rainbowtags/dwm-rainbowtags-6.1.diff
_AT_@ -0,0 +1,65 @@
+From 5b45f88e87c772f7bc18c86f4de7ab3bac8c39c9 Mon Sep 17 00:00:00 2001
+From: Jared <7060603_AT_hotmail.ca>
+Date: Fri, 26 Feb 2021 02:59:07 -0500
+Subject: [PATCH] rainbowtags: Unique ClrScheme for each tag when selected
+
+Allow selected tags to be unique colours. tagselfg contains the foreground
+colors, and tagselbg contains the background colors.
+---
+ config.def.h | 3 +++
+ dwm.c | 11 ++++++++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 7054c06..0abf2f5 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -19,6 +19,9 @@ static const int topbar = 1; /* 0 means bottom bar */
+ /* tagging */
+ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+
++static const char *tagselfg[] = { "#ffffff", "#ffffff", "#000000", "#000000", "#ffffff", "#ffffff", "#ffffff", "#000000", "#ffffff" };
++static const char *tagselbg[] = { "#ff0000", "#ff7f00", "#ffff00", "#00ff00", "#0000ff", "#4b0082", "#9400d3", "#ffffff", "#000000" };
++
+ static const Rule rules[] = {
+ /* xprop(1):
+ * WM_CLASS(STRING) = instance, class
+diff --git a/dwm.c b/dwm.c
+index 0362114..53d7ead 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -273,6 +273,8 @@ static Window root;
+ /* compile-time check if all tags fit into an unsigned int bit array. */
+ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
+
++static ClrScheme tagscheme[LENGTH(tags)];
++
+ /* function implementations */
+ void
+ applyrules(Client *c)
+_AT_@ -718,7 +720,7 @@ 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 ? &scheme[SchemeSel] : &scheme[SchemeNorm]);
++ drw_setscheme(drw, m->tagset[m->seltags] & 1 << i ? &tagscheme[i] : &scheme[SchemeNorm]);
+ drw_text(drw, x, 0, w, bh, tags[i], urg & 1 << i);
+ drw_rect(drw, x + 1, 1, dx, dx, m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ occ & 1 << i, urg & 1 << i);
+_AT_@ -1586,6 +1588,13 @@ setup(void)
+ scheme[SchemeSel].border = drw_clr_create(drw, selbordercolor);
+ scheme[SchemeSel].bg = drw_clr_create(drw, selbgcolor);
+ scheme[SchemeSel].fg = drw_clr_create(drw, selfgcolor);
++
++ for (unsigned int i = 0; i < LENGTH(tags); i++) {
++ tagscheme[i].bg = drw_clr_create(drw, tagselbg[i]);
++ tagscheme[i].fg = drw_clr_create(drw, tagselfg[i]);
++ tagscheme[i].border = drw_clr_create(drw, selbordercolor);
++ }
++
+ /* init bars */
+ updatebars();
+ updatestatus();
+--
+2.30.1
+
diff --git a/dwm.suckless.org/patches/rainbowtags/index.md b/dwm.suckless.org/patches/rainbowtags/index.md
new file mode 100644
index 00000000..dddd671b
--- /dev/null
+++ b/dwm.suckless.org/patches/rainbowtags/index.md
_AT_@ -0,0 +1,21 @@
+rainbowtags
+====
+
+Description
+-----------
+Allows each tag to be an independent/unique color
+when selected.
+
+Two arrays of colors (tagselfg, tagselbg) are used
+for tags in place of selfgcolor and selbgcolor.
+
+Inspired by colorful 90s & 2000s software.
+
+Download
+--------
+* [dwm-rainbowtags-6.1.diff](dwm-rainbowtags-6.1.diff)
+
+Authors
+-------
+* Jared - <7060603_AT_hotmail.ca>
+
Received on Fri Feb 26 2021 - 09:54:03 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 26 2021 - 10:00:48 CET