commit 68f58a0a5e03fc2c2b0d5088429d0c6df92eb538
parent 0149fd191be5fc1400989df30ef988ef25745ae6
Author: Andrew Antle <andrew@antlechrist.org>
Date: Tue, 15 Jun 2010 22:51:47 -0400
Created monocle_count.md, added v4hn's diff.
Diffstat:
2 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/dwm.suckless.org/patches/dwm-5.8.2-monocle_count.diff b/dwm.suckless.org/patches/dwm-5.8.2-monocle_count.diff
@@ -0,0 +1,52 @@
+diff -r -U5 dwm-5.8.2/dwm.c dwm-5.8.2_monocle_count/dwm.c
+--- dwm-5.8.2/dwm.c 2010-06-04 12:39:15.000000000 +0200
++++ dwm-5.8.2_monocle_count/dwm.c 2010-06-15 15:52:51.000000000 +0200
+@@ -684,10 +684,12 @@
+ void
+ drawbar(Monitor *m) {
+ int x;
+ unsigned int i, occ = 0, urg = 0;
+ unsigned long *col;
++ unsigned int a= 0, s= 0;
++ char posbuf[10];
+ Client *c;
+
+ for(c = m->clients; c; c = c->next) {
+ occ |= c->tags;
+ if(c->isurgent)
+@@ -704,10 +706,22 @@
+ }
+ dc.w = blw = TEXTW(m->ltsymbol);
+ drawtext(m->ltsymbol, dc.norm, False);
+ dc.x += dc.w;
+ x = dc.x;
++ if(m->lt[m->sellt]->arrange == monocle){
++ for(c= nexttiled(m->clients), a= 0, s= 0; c; c= nexttiled(c->next), a++)
++ if(c == m->stack)
++ s= a;
++ if(!s && a)
++ s= a;
++ snprintf(posbuf, LENGTH(posbuf), "[%d/%d]", s, a);
++ dc.w= TEXTW(posbuf);
++ drawtext(posbuf, dc.norm, False);
++ x= dc.x + dc.w;
++ }
++
+ if(m == selmon) { /* status is only drawn on selected monitor */
+ dc.w = TEXTW(stext);
+ dc.x = m->ww - dc.w;
+ if(dc.x < x) {
+ dc.x = x;
+@@ -1184,12 +1198,10 @@
+ Client *c;
+
+ for(c = m->clients; c; c = c->next)
+ if(ISVISIBLE(c))
+ n++;
+- if(n > 0) /* override layout symbol */
+- snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
+ }
+
+ void
diff --git a/dwm.suckless.org/patches/monocle_count.md b/dwm.suckless.org/patches/monocle_count.md
@@ -0,0 +1,16 @@
+MONOCLE COUNT
+=============
+
+Description
+-----------
+`monocle_count` prints the total number of clients and the number of the
+currently activated client beside the symbol of the monocle layout, while the
+current release prints only the number of total clients within the symbol.
+
+Download
+--------
+* [dwm-5.8.2-monocle_count.diff](dwm-5.8.2-monocle_count.diff)
+
+Author
+------
+* v4hn - `v4hn.de`