My configuration of sxmo fork of suckless dwm.

git clone git://watertao.xyz/programs/sxmo-dwm.git

commit b4ef3d1e7bc52dc51b44f968b56224c54b8dbc82
parent 5711516944fe9998e498580285706f1127f4a9c8
Author: Peter John Hartman <peterjohnhartman@gmail.com>
Date:   Mon,  6 Feb 2023 12:43:04 -0600

remove vacant tags

modified from here:
https://dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.3.diff

Diffstat:
Mdwm.c | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -632,9 +632,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; + 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; @@ -985,18 +991,14 @@ drawbar(Monitor *m) } 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; indn = 0; 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, False); - for (c = m->clients; c; c = c->next) { - if (c->tags & (1 << i) && !c->iskbd) { - drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i); - indn++; - } - } - x += w; } w = blw = TEXTW(m->ltsymbol);