dwm-6.1-statusallmons.diff - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
dwm-6.1-statusallmons.diff (1026B) | |
--- | |
1 URL: http://dwm.suckless.org/patches/statusallmons | |
2 This patch draws and updates the statusbar on all monitors. | |
3 | |
4 Index: dwm/dwm.c | |
5 =================================================================== | |
6 --- dwm/dwm.c.orig 2014-02-09 15:24:22.768117261 +0100 | |
7 +++ dwm/dwm.c 2014-02-09 15:24:22.764117260 +0100 | |
8 @@ -715,17 +715,13 @@ | |
9 drw_text(drw, x, 0, w, bh, m->ltsymbol, 0); | |
10 x += w; | |
11 xx = x; | |
12 - if(m == selmon) { /* status is only drawn on selected monitor */ | |
13 - w = TEXTW(stext); | |
14 - x = m->ww - w; | |
15 - if(x < xx) { | |
16 - x = xx; | |
17 - w = m->ww - xx; | |
18 - } | |
19 - drw_text(drw, x, 0, w, bh, stext, 0); | |
20 + w = TEXTW(stext); | |
21 + x = m->ww - w; | |
22 + if(x < xx) { | |
23 + x = xx; | |
24 + w = m->ww - xx; | |
25 } | |
26 - else | |
27 - x = m->ww; | |
28 + drw_text(drw, x, 0, w, bh, stext, 0); | |
29 if((w = x - xx) > bh) { | |
30 x = xx; | |
31 if(m->sel) { | |
32 @@ -1923,9 +1919,11 @@ | |
33 | |
34 void | |
35 updatestatus(void) { | |
36 + Monitor* m; | |
37 if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) | |
38 strcpy(stext, "dwm-"VERSION); | |
39 - drawbar(selmon); | |
40 + for(m = mons; m; m = m->next) | |
41 + drawbar(m); | |
42 } | |
43 | |
44 void |