[wiki] [sites] Add hide_vacant_tags v6.4 || Max R. P. Grossmann

From: <git_AT_suckless.org>
Date: Sun, 17 Mar 2024 20:27:33 +0100

commit 0c9031afd3e8caafdb05ad60daf26fee4c23b274
Author: Max R. P. Grossmann <m_AT_max.pm>
Date: Sun Mar 17 19:18:51 2024 +0000

    Add hide_vacant_tags v6.4
    
    This commit re-introduces a proviso originally introduced by Jochen
    Sprickerhof (7c0138a22) in which clients assigned to all tags ("tag 0") should
    not mark all individual tags as occupied. Furthermore, a bug in his original
    proviso was fixed: whereas his original patch only worked for 8 tags (c->tags
    == 255), this new version checks c->tags == TAGMASK.

diff --git a/dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.4.diff b/dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.4.diff
new file mode 100644
index 00000000..42d9c058
--- /dev/null
+++ b/dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.4.diff
_AT_@ -0,0 +1,48 @@
+:100644 100644 f1d86b2 0000000 M dwm.c
+
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..d41cc14 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -433,9 +433,15 @@ buttonpress(XEvent *e)
+ }
+ if (ev->window == selmon->barwin) {
+ i = x = 0;
+- do
++ unsigned int occ = 0;
++ for(c = m->clients; c; c=c->next)
++ occ |= c->tags == TAGMASK ? 0 : c->tags;
++ do {
++ /* Do not reserve space for vacant tags */
++ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
++ continue;
+ x += TEXTW(tags[i]);
+- while (ev->x >= x && ++i < LENGTH(tags));
++ } while (ev->x >= x && ++i < LENGTH(tags));
+ if (i < LENGTH(tags)) {
+ click = ClkTagBar;
+ arg.ui = 1 << i;
+_AT_@ -715,19 +721,18 @@ drawbar(Monitor *m)
+ }
+
+ for (c = m->clients; c; c = c->next) {
+- occ |= c->tags;
++ occ |= c->tags == TAGMASK ? 0 : c->tags;
+ if (c->isurgent)
+ urg |= c->tags;
+ }
+ x = 0;
+ for (i = 0; i < LENGTH(tags); i++) {
++ /* Do not draw vacant tags */
++ if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
++ continue;
+ 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;
+ }
+ w = TEXTW(m->ltsymbol);
diff --git a/dwm.suckless.org/patches/hide_vacant_tags/index.md b/dwm.suckless.org/patches/hide_vacant_tags/index.md
index 0cdf821f..5f39800d 100644
--- a/dwm.suckless.org/patches/hide_vacant_tags/index.md
+++ b/dwm.suckless.org/patches/hide_vacant_tags/index.md
_AT_@ -4,7 +4,8 @@ hide vacant tags
 Description
 -----------
 This patch prevents dwm from drawing tags with no clients (i.e. vacant) on the
-bar.
+bar. Moreover, clients assigned to all tags ("tag 0") do not count towards
+each individual tag.
 
 It also makes sure that pressing a tag on the bar behaves accordingly by not
 reserving reactive regions on the bar for vacant tags.
_AT_@ -15,6 +16,7 @@ contrast than if there were filled/empty rectangles.
 
 Download
 --------
+* [dwm-hide\_vacant\_tags-6.4.diff](dwm-hide_vacant_tags-6.4.diff) - 2024-03-17
 * [dwm-hide\_vacant\_tags-6.3.diff](dwm-hide_vacant_tags-6.3.diff) - 2022-02-09
 * [dwm-hide\_vacant\_tags-6.1.diff](dwm-hide_vacant_tags-6.1.diff) - 2016-01-22
 * [dwm-hide\_vacant\_tags-git-20160626-7af4d43.diff](dwm-hide_vacant_tags-git-20160626-7af4d43.diff)
_AT_@ -26,3 +28,4 @@ Author
 * [OndÅ™ej Grover](mailto:ondrej.grover_AT_gmail.com)
 * Matthew Boswell - mordervomubel+suckless at lockmail dot us (mechanical update for dwm 6.1 release)
 * [Jochen Sprickerhof](mailto:project_AT_firstname.lastname.de) (hide 0 tagged clients)
+* [Max R. P. Grossmann](https://max.pm/contact/) (hide 0 tagged clients no matter the number of tags)
Received on Sun Mar 17 2024 - 20:27:33 CET

This archive was generated by hypermail 2.3.0 : Sun Mar 17 2024 - 20:36:54 CET