dwm-clientindicators-6.2.diff - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
dwm-clientindicators-6.2.diff (1295B)
---
1 From 8c72f9ea7c9cd8d254b52a4f7059113c41483597 Mon Sep 17 00:00:00 2001
2 From: Miles Alan <m@milesalan.com>
3 Date: Mon, 17 Aug 2020 20:33:45 -0500
4 Subject: [PATCH] Draws a dot indicator overlayed on each tag icon for each
5 client. The selected client is drawn as a larger horizontal line.
6
7 ---
8 dwm.c | 14 ++++++++++----
9 1 file changed, 10 insertions(+), 4 deletions(-)
10
11 diff --git a/dwm.c b/dwm.c
12 index 4465af1..e0ca438 100644
13 --- a/dwm.c
14 +++ b/dwm.c
15 @@ -695,6 +695,7 @@ dirtomon(int dir)
16 void
17 drawbar(Monitor *m)
18 {
19 + int indn;
20 int x, w, sw = 0;
21 int boxs = drw->fonts->h / 9;
22 int boxw = drw->fonts->h / 6 + 2;
23 @@ -715,13 +716,18 @@ drawbar(Monitor *m)
24 }
25 x = 0;
26 for (i = 0; i < LENGTH(tags); i++) {
27 + indn = 0;
28 w = TEXTW(tags[i]);
29 drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
30 drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
31 - if (occ & 1 << i)
32 - drw_rect(drw, x + boxs, boxs, boxw, boxw,
33 - m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
34 - urg & 1 << i);
35 +
36 + for (c = m->clients; c; c = c->next) {
37 + if (c->tags & (1 << i)) {
38 + drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i);
39 + indn++;
40 + }
41 + }
42 +
43 x += w;
44 }
45 w = blw = TEXTW(m->ltsymbol);
46 --
47 2.25.4
48