sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 0c9031afd3e8caafdb05ad60daf26fee4c23b274
parent e3fd8da0b7d64548d9650b97524cd492e20b04cc
Author: Max R. P. Grossmann <m@max.pm>
Date:   Sun, 17 Mar 2024 19:18:51 +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.

Diffstat:
Adwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.4.diff | 48++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/hide_vacant_tags/index.md | 5++++-
2 files changed, 52 insertions(+), 1 deletion(-)

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 @@ -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 +@@ -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; +@@ -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 @@ -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. @@ -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) @@ -26,3 +28,4 @@ Author * [Ondřej Grover](mailto:ondrej.grover@gmail.com) * Matthew Boswell - mordervomubel+suckless at lockmail dot us (mechanical update for dwm 6.1 release) * [Jochen Sprickerhof](mailto:project@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)