--- a/config.arg.h Mon Jan 08 13:01:37 2007 +0100
+++ b/config.arg.h Mon Jan 08 17:33:24 2007 +0100
@@ -7,7 +7,7 @@
#define DEFMODE dotile /* dofloat */
#define FLOATSYMBOL "><>"
-#define TILESYMBOL "[]="
+#define TILESYMBOL "[%u]="
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#111111"
--- a/config.default.h Mon Jan 08 13:01:37 2007 +0100
+++ b/config.default.h Mon Jan 08 17:33:24 2007 +0100
@@ -7,7 +7,7 @@
#define DEFMODE dotile /* dofloat */
#define FLOATSYMBOL "><>"
-#define TILESYMBOL "[]="
+#define TILESYMBOL "[%u]="
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#333366"
--- a/config.mk Mon Jan 08 13:01:37 2007 +0100
+++ b/config.mk Mon Jan 08 17:33:24 2007 +0100
@@ -1,5 +1,5 @@
# dwm version
-VERSION = 2.9
+VERSION = 3.0
# Customize below to fit your system
--- a/draw.c Mon Jan 08 13:01:37 2007 +0100
+++ b/draw.c Mon Jan 08 17:33:24 2007 +0100
@@ -120,7 +120,7 @@
dc.x += dc.w;
}
dc.w = bmw;
- drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False, False);
+ drawtext(mtext, dc.status, False, False);
x = dc.x + dc.w;
dc.w = textw(stext);
dc.x = bw - dc.w;
--- a/dwm.h Mon Jan 08 13:01:37 2007 +0100
+++ b/dwm.h Mon Jan 08 17:33:24 2007 +0100
@@ -93,6 +93,7 @@
extern const char *tags[]; /* all tags */
extern char stext[1024]; /* status text */
+extern char mtext[32]; /* mode text */
extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
extern int screen, sx, sy, sw, sh; /* screen geometry */
extern int wax, way, wah, waw; /* windowarea geometry */
--- a/main.c Mon Jan 08 13:01:37 2007 +0100
+++ b/main.c Mon Jan 08 17:33:24 2007 +0100
@@ -17,7 +17,7 @@
/* extern */
-char stext[1024];
+char stext[1024], mtext[32];
Bool *seltag;
int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
unsigned int master, nmaster, ntags, numlockmask;
@@ -128,12 +128,13 @@
dc.status[ColFG] = getcolor(STATUSFGCOLOR);
setfont(FONT);
/* geometry */
- bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL);
sx = sy = 0;
sw = DisplayWidth(dpy, screen);
sh = DisplayHeight(dpy, screen);
master = MASTER;
nmaster = NMASTER;
+ snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
+ bmw = textw(mtext);
/* bar */
bx = sx;
by = sy;
--- a/view.c Mon Jan 08 13:01:37 2007 +0100
+++ b/view.c Mon Jan 08 17:33:24 2007 +0100
@@ -2,6 +2,7 @@
* See LICENSE file for license details.
*/
#include "dwm.h"
+#include <stdio.h>
/* static */
@@ -149,10 +150,15 @@
void
incnmaster(Arg *arg) {
- if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
+ if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
return;
nmaster += arg->i;
- arrange();
+ snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
+ bmw = textw(mtext);
+ if(sel)
+ arrange();
+ else
+ drawstatus();
}
Bool
@@ -218,6 +224,8 @@
void
togglemode(Arg *arg) {
arrange = (arrange == dofloat) ? dotile : dofloat;
+ snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
+ bmw = textw(mtext);
if(sel)
arrange();
else