#define DEFMODE dotile /* dofloat */
#define FLOATSYMBOL "><>"
-#define TILESYMBOL "[]="
+#define TILESYMBOL "[%u]="
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#111111"
#define DEFMODE dotile /* dofloat */
#define FLOATSYMBOL "><>"
-#define TILESYMBOL "[]="
+#define TILESYMBOL "[%u]="
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
#define NORMBGCOLOR "#333366"
# dwm version
-VERSION = 2.9
+VERSION = 3.0
# Customize below to fit your system
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;
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 */
/* 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;
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;
* See LICENSE file for license details.
*/
#include "dwm.h"
+#include <stdio.h>
/* static */
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
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