Skip to content

Commit

Permalink
Make tags "collapse" when only tags 1-5 are occupied and "expand" whe…
Browse files Browse the repository at this point in the history
…n 6-9 become relevant
  • Loading branch information
dther committed Dec 11, 2023
1 parent fa4844b commit b738174
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@ drawbar(Monitor *m)
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
if (!(occ & 1 << i) && (occ < (0x1F)) && (i > 4)) {
/* TODO: make this configurable */
/* hide tags after 5, unless they or all tags below are occupied */
const char* moretags = "+"; /* pseudo-tag that expands when added to */
drw_text(drw, x, 0, w, bh, lrpad / 2, moretags, urg & 1 << i);
x += w;
break;
}
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,
Expand Down

0 comments on commit b738174

Please sign in to comment.