diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2009-07-09 19:58:58 +0100 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2009-07-09 19:58:58 +0100 |
| commit | 87526be6f05ed892083d874c27f18b6c9e21881e (patch) | |
| tree | 07a05c6309aa0c3416ef385725b5a8ff9e0a37e3 | |
| parent | removed monsyms, useless (diff) | |
| download | dwm-87526be6f05ed892083d874c27f18b6c9e21881e.tar.gz dwm-87526be6f05ed892083d874c27f18b6c9e21881e.zip | |
added client number printing right of layout symbol
| -rw-r--r-- | dwm.c | 14 |
1 files changed, 9 insertions, 5 deletions
| @@ -236,7 +236,7 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee); | |||
| 236 | static void zoom(const Arg *arg); | 236 | static void zoom(const Arg *arg); |
| 237 | 237 | ||
| 238 | /* variables */ | 238 | /* variables */ |
| 239 | static char stext[256]; | 239 | static char stext[256], ntext[8]; |
| 240 | static int screen; | 240 | static int screen; |
| 241 | static int sw, sh; /* X display screen geometry x, y, width, height */ | 241 | static int sw, sh; /* X display screen geometry x, y, width, height */ |
| 242 | static int bh, blw = 0; /* bar geometry */ | 242 | static int bh, blw = 0; /* bar geometry */ |
| @@ -641,11 +641,13 @@ dirtomon(int dir) { | |||
| 641 | void | 641 | void |
| 642 | drawbar(Monitor *m) { | 642 | drawbar(Monitor *m) { |
| 643 | int x; | 643 | int x; |
| 644 | unsigned int i, occ = 0, urg = 0; | 644 | unsigned int i, n = 0, occ = 0, urg = 0; |
| 645 | unsigned long *col; | 645 | unsigned long *col; |
| 646 | Client *c; | 646 | Client *c; |
| 647 | 647 | ||
| 648 | for(c = m->clients; c; c = c->next) { | 648 | for(c = m->clients; c; c = c->next) { |
| 649 | if(ISVISIBLE(c)) | ||
| 650 | n++; | ||
| 649 | occ |= c->tags; | 651 | occ |= c->tags; |
| 650 | if(c->isurgent) | 652 | if(c->isurgent) |
| 651 | urg |= c->tags; | 653 | urg |= c->tags; |
| @@ -662,10 +664,12 @@ drawbar(Monitor *m) { | |||
| 662 | if(blw > 0) { | 664 | if(blw > 0) { |
| 663 | dc.w = blw; | 665 | dc.w = blw; |
| 664 | drawtext(m->lt[m->sellt]->symbol, dc.norm, False); | 666 | drawtext(m->lt[m->sellt]->symbol, dc.norm, False); |
| 665 | x = dc.x + dc.w; | 667 | dc.x += dc.w; |
| 666 | } | 668 | } |
| 667 | else | 669 | snprintf(ntext, sizeof ntext, "%u", n); |
| 668 | x = dc.x; | 670 | dc.w = TEXTW(ntext); |
| 671 | drawtext(ntext, dc.norm, False); | ||
| 672 | x = (dc.x += dc.w); | ||
| 669 | if(m == selmon) { /* status is only drawn on selected monitor */ | 673 | if(m == selmon) { /* status is only drawn on selected monitor */ |
| 670 | dc.w = TEXTW(stext); | 674 | dc.w = TEXTW(stext); |
| 671 | dc.x = m->ww - dc.w; | 675 | dc.x = m->ww - dc.w; |
