sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-statusallmons-6.0.diff (982B)


      1 URL: http://dwm.suckless.org/patches/statusallmons
      2 This patch draws and updates the statusbar on all monitors.
      3 
      4 diff -r ec4baab78314 dwm.c
      5 --- a/dwm.c	Mon Dec 19 15:38:30 2011 +0100
      6 +++ b/dwm.c	Fri Apr 06 08:23:39 2012 +0200
      7 @@ -740,17 +740,13 @@
      8  	drawtext(m->ltsymbol, dc.norm, False);
      9  	dc.x += dc.w;
     10  	x = dc.x;
     11 -	if(m == selmon) { /* status is only drawn on selected monitor */
     12 -		dc.w = TEXTW(stext);
     13 -		dc.x = m->ww - dc.w;
     14 -		if(dc.x < x) {
     15 -			dc.x = x;
     16 -			dc.w = m->ww - x;
     17 -		}
     18 -		drawtext(stext, dc.norm, False);
     19 +	dc.w = TEXTW(stext);
     20 +	dc.x = m->ww - dc.w;
     21 +	if(dc.x < x) {
     22 +		dc.x = x;
     23 +		dc.w = m->ww - x;
     24  	}
     25 -	else
     26 -		dc.x = m->ww;
     27 +	drawtext(stext, dc.norm, False);
     28  	if((dc.w = dc.x - x) > bh) {
     29  		dc.x = x;
     30  		if(m->sel) {
     31 @@ -2005,9 +2001,11 @@
     32  
     33  void
     34  updatestatus(void) {
     35 +	Monitor* m;
     36  	if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
     37  		strcpy(stext, "dwm-"VERSION);
     38 -	drawbar(selmon);
     39 +	for(m = mons; m; m = m->next)
     40 +		drawbar(m);
     41  }
     42  
     43  void