dwm-monocle_count-5.8.2.diff - sites - public wiki contents of suckless.org
 (HTM) git clone git://git.suckless.org/sites
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       dwm-monocle_count-5.8.2.diff (1384B)
       ---
            1 diff -r -U5 dwm-5.8.2/dwm.c dwm-5.8.2_monocle_count/dwm.c
            2 --- dwm-5.8.2/dwm.c        2010-06-04 12:39:15.000000000 +0200
            3 +++ dwm-5.8.2_monocle_count/dwm.c        2010-06-15 15:52:51.000000000 +0200
            4 @@ -684,10 +684,12 @@
            5  void
            6  drawbar(Monitor *m) {
            7          int x;
            8          unsigned int i, occ = 0, urg = 0;
            9          unsigned long *col;
           10 +        unsigned int a= 0, s= 0;
           11 +        char posbuf[10];
           12          Client *c;
           13  
           14          for(c = m->clients; c; c = c->next) {
           15                  occ |= c->tags;
           16                  if(c->isurgent)
           17 @@ -704,10 +706,22 @@
           18          }
           19          dc.w = blw = TEXTW(m->ltsymbol);
           20          drawtext(m->ltsymbol, dc.norm, False);
           21          dc.x += dc.w;
           22          x = dc.x;
           23 +        if(m->lt[m->sellt]->arrange == monocle){
           24 +                for(c= nexttiled(m->clients), a= 0, s= 0; c; c= nexttiled(c->next), a++)
           25 +                        if(c == m->stack)
           26 +                                s= a;
           27 +                if(!s && a)
           28 +                        s= a;
           29 +                snprintf(posbuf, LENGTH(posbuf), "[%d/%d]", s, a);
           30 +                dc.w= TEXTW(posbuf);
           31 +                drawtext(posbuf, dc.norm, False);
           32 +                x= dc.x + dc.w;
           33 +        }
           34 +        
           35          if(m == selmon) { /* status is only drawn on selected monitor */
           36                  dc.w = TEXTW(stext);
           37                  dc.x = m->ww - dc.w;
           38                  if(dc.x < x) {
           39                          dc.x = x;
           40 @@ -1184,12 +1198,10 @@
           41          Client *c;
           42  
           43          for(c = m->clients; c; c = c->next)
           44                  if(ISVISIBLE(c))
           45                          n++;
           46 -        if(n > 0) /* override layout symbol */
           47 -                snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
           48          for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
           49                  resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
           50  }
           51  
           52  void