Added patch to draw per-client indicators over the tag section of the status bar.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Fri, 3 Feb 2023 03:29:44 +0000 (19:29 -0800)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Fri, 3 Feb 2023 03:29:44 +0000 (19:29 -0800)
README
dwm.c

diff --git a/README b/README
index 68d1ce0..e2ab93b 100644 (file)
--- a/README
+++ b/README
@@ -2,6 +2,9 @@ This git repository contains my personal branch of dwm-6.4.
 
 The changes made to stock dwm add the following abilities.
 
 
 The changes made to stock dwm add the following abilities.
 
+  - Draw per-client indicators in the tag section of the status bar.
+    <https://dwm.suckless.org/patches/clientindicators/>
+
   - Prompt the user before exiting/restarting dwm.
     <https://dwm.suckless.org/patches/quitprompt/>
 
   - Prompt the user before exiting/restarting dwm.
     <https://dwm.suckless.org/patches/quitprompt/>
 
diff --git a/dwm.c b/dwm.c
index 52d34ad..47237ea 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -748,6 +748,7 @@ dirtomon(int dir)
 void
 drawbar(Monitor *m)
 {
 void
 drawbar(Monitor *m)
 {
+       int indn;
        int x, w, tw = 0;
        int boxs = drw->fonts->h / 9;
        int boxw = drw->fonts->h / 6 + 2;
        int x, w, tw = 0;
        int boxs = drw->fonts->h / 9;
        int boxw = drw->fonts->h / 6 + 2;
@@ -771,13 +772,18 @@ drawbar(Monitor *m)
        }
        x = 0;
        for (i = 0; i < LENGTH(tags); i++) {
        }
        x = 0;
        for (i = 0; i < LENGTH(tags); i++) {
+               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);
                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);
+
+               for (c = m->clients; c; c = c->next) {
+                       if (c->tags & (1 << i)) {
+                               drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i);
+                               indn++;
+                       }
+               }
+
                x += w;
        }
        w = TEXTW(m->ltsymbol);
                x += w;
        }
        w = TEXTW(m->ltsymbol);