[wiki] [sites] Added the alttagsdecoration patch' wiki page || Luigi Foscari

From: <git_AT_suckless.org>
Date: Sat, 04 Jan 2020 14:46:20 +0100

commit f8e3f2eed11fe8a2dc3b8bafcd2a02085f02294a
Author: Luigi Foscari <foscari.luigi_AT_gmail.com>
Date: Sat Jan 4 14:45:50 2020 +0100

    Added the alttagsdecoration patch' wiki page

diff --git a/dwm.suckless.org/patches/alttagsdecoration/alttagsdecoration.png b/dwm.suckless.org/patches/alttagsdecoration/alttagsdecoration.png
new file mode 100644
index 00000000..dd3d716a
Binary files /dev/null and b/dwm.suckless.org/patches/alttagsdecoration/alttagsdecoration.png differ
diff --git a/dwm.suckless.org/patches/alttagsdecoration/dwm-alttagsdecoration-2020010304-cb3f58a.diff b/dwm.suckless.org/patches/alttagsdecoration/dwm-alttagsdecoration-2020010304-cb3f58a.diff
new file mode 100644
index 00000000..fcbc1ef1
--- /dev/null
+++ b/dwm.suckless.org/patches/alttagsdecoration/dwm-alttagsdecoration-2020010304-cb3f58a.diff
_AT_@ -0,0 +1,67 @@
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..d4b11fc 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -20,6 +20,7 @@ static const char *colors[][3] = {
+
+ /* tagging */
+ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
++static const char *alttags[] = { "<01>", "<02>", "<03>", "<04>", "<05>" };
+
+ static const Rule rules[] = {
+ /* xprop(1):
+diff --git a/dwm.c b/dwm.c
+index 4465af1..a394159 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -416,7 +416,7 @@ attachstack(Client *c)
+ void
+ buttonpress(XEvent *e)
+ {
+- unsigned int i, x, click;
++ unsigned int i, x, click, occ;
+ Arg arg = {0};
+ Client *c;
+ Monitor *m;
+_AT_@ -430,9 +430,13 @@ buttonpress(XEvent *e)
+ focus(NULL);
+ }
+ if (ev->window == selmon->barwin) {
+- i = x = 0;
++ i = x = occ = 0;
++ /* Bitmask of occupied tags */
++ for (c = m->clients; c; c = c->next)
++ occ |= c->tags;
++
+ do
+- x += TEXTW(tags[i]);
++ x += TEXTW(occ & 1 << i ? alttags[i] : tags[i]);
+ while (ev->x >= x && ++i < LENGTH(tags));
+ if (i < LENGTH(tags)) {
+ click = ClkTagBar;
+_AT_@ -699,6 +703,7 @@ drawbar(Monitor *m)
+ int boxs = drw->fonts->h / 9;
+ int boxw = drw->fonts->h / 6 + 2;
+ unsigned int i, occ = 0, urg = 0;
++ const char *tagtext;
+ Client *c;
+
+ /* draw status first so it can be overdrawn by tags later */
+_AT_@ -715,13 +720,10 @@ 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_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);
++ tagtext = occ & 1 << i ? alttags[i] : tags[i];
++ w = TEXTW(tagtext);
++ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
++ drw_text(drw, x, 0, w, bh, lrpad / 2, tagtext, urg & 1 << i);
+ x += w;
+ }
+ w = blw = TEXTW(m->ltsymbol);
diff --git a/dwm.suckless.org/patches/alttagsdecoration/index.md b/dwm.suckless.org/patches/alttagsdecoration/index.md
new file mode 100644
index 00000000..127125fa
--- /dev/null
+++ b/dwm.suckless.org/patches/alttagsdecoration/index.md
_AT_@ -0,0 +1,16 @@
+alttagsdecoration
+=================
+
+Description
+-----------
+This patches provides the ability to use an alternative text for tags which contain at least one window. This patch replaces the standard behavious of drawing a little box on the top left edge of the tag box.
+
+![alttagsdecoration screenshot](alttagsdecoration.png)
+
+Download
+--------
+* [dwm-alttagsdecoration-2020010304-cb3f58a.diff](dwm-alttagsdecoration-2020010304-cb3f58a.diff) (04.01.2020)
+
+Authors
+-------
+* Luigi Foscari <luigi.foscari[at]gmail.com>
Received on Sat Jan 04 2020 - 14:46:20 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 04 2020 - 14:48:28 CET