-
Notifications
You must be signed in to change notification settings - Fork 0
/
dwm.c.rej
54 lines (51 loc) · 2.07 KB
/
dwm.c.rej
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- dwm.c 2019-02-02 18:25:28.000000000 +0530
+++ dwm.c 2020-09-30 21:52:33.227950503 +0530
@@ -713,7 +731,7 @@
void
drawbar(Monitor *m)
{
- int x, w, sw = 0;
+ int x, w;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
@@ -721,9 +739,30 @@
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
- drw_setscheme(drw, scheme[SchemeNorm]);
- sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
- drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
+ char *ts = stextc;
+ char *tp = stextc;
+ char ctmp;
+
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ x = drw_text(drw, m->ww - wstext, 0, lrpad / 2, bh, 0, "", 0); /* to keep left padding clean */
+ for (;;) {
+ if ((unsigned char)*ts > LENGTH(colors) + 10) {
+ ts++;
+ continue;
+ }
+ ctmp = *ts;
+ *ts = '\0';
+ if (*tp != '\0')
+ x = drw_text(drw, x, 0, TTEXTW(tp), bh, 0, tp, 0);
+ if (ctmp == '\0')
+ break;
+ /* - 11 to compensate for + 10 above */
+ drw_setscheme(drw, scheme[ctmp - 11]);
+ *ts = ctmp;
+ tp = ++ts;
+ }
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ drw_text(drw, x, 0, m->ww - x, bh, 0, "", 0); /* to keep right padding clean */
}
for (c = m->clients; c; c = c->next) {
@@ -746,7 +785,7 @@
drw_setscheme(drw, scheme[SchemeNorm]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
- if ((w = m->ww - sw - x) > bh) {
+ if ((w = m->ww - wstext - x) > bh) {
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);