diff options
| -rw-r--r-- | config.def.h | 8 | ||||
| -rw-r--r-- | dwm.c | 16 |
2 files changed, 16 insertions, 8 deletions
diff --git a/config.def.h b/config.def.h index 8130909..76e7ed3 100644 --- a/config.def.h +++ b/config.def.h | |||
| @@ -28,8 +28,8 @@ DEFGEOM(dual, 0, 0,1280, 0, bh, ww, wh-bh, wx, wy, 1280,800-bh, 1280, 0, w | |||
| 28 | 28 | ||
| 29 | Geom geoms[] = { | 29 | Geom geoms[] = { |
| 30 | /* symbol function */ | 30 | /* symbol function */ |
| 31 | { "[]", single }, /* first entry is default */ | 31 | { "<>", single }, /* first entry is default */ |
| 32 | { "[][]", dual }, | 32 | { ")(", dual }, |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | /* layout(s) */ | 35 | /* layout(s) */ |
| @@ -48,8 +48,8 @@ Layout layouts[] = { | |||
| 48 | #define MODKEY Mod1Mask | 48 | #define MODKEY Mod1Mask |
| 49 | Key keys[] = { | 49 | Key keys[] = { |
| 50 | /* modifier key function argument */ | 50 | /* modifier key function argument */ |
| 51 | { MODKEY, XK_a, setgeom, "[][]" }, | 51 | { MODKEY, XK_a, setgeom, ")(" }, |
| 52 | { MODKEY, XK_d, setgeom, "[]" }, | 52 | { MODKEY, XK_d, setgeom, "<>" }, |
| 53 | { MODKEY, XK_p, spawn, | 53 | { MODKEY, XK_p, spawn, |
| 54 | "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" }, | 54 | "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" }, |
| 55 | { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" }, | 55 | { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" }, |
| @@ -210,7 +210,7 @@ void zoom(const char *arg); | |||
| 210 | char stext[256], buf[256]; | 210 | char stext[256], buf[256]; |
| 211 | int screen, sx, sy, sw, sh; | 211 | int screen, sx, sy, sw, sh; |
| 212 | int (*xerrorxlib)(Display *, XErrorEvent *); | 212 | int (*xerrorxlib)(Display *, XErrorEvent *); |
| 213 | int bx, by, bw, bh, blw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh; | 213 | int bx, by, bw, bh, blw, bgw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh; |
| 214 | unsigned int numlockmask = 0; | 214 | unsigned int numlockmask = 0; |
| 215 | void (*handler[LASTEvent]) (XEvent *) = { | 215 | void (*handler[LASTEvent]) (XEvent *) = { |
| 216 | [ButtonPress] = buttonpress, | 216 | [ButtonPress] = buttonpress, |
| @@ -322,10 +322,10 @@ buttonpress(XEvent *e) { | |||
| 322 | XButtonPressedEvent *ev = &e->xbutton; | 322 | XButtonPressedEvent *ev = &e->xbutton; |
| 323 | 323 | ||
| 324 | if(ev->window == barwin) { | 324 | if(ev->window == barwin) { |
| 325 | x = 0; | 325 | x = bgw; |
| 326 | for(i = 0; i < LENGTH(tags); i++) { | 326 | for(i = 0; i < LENGTH(tags); i++) { |
| 327 | x += textw(tags[i]); | 327 | x += textw(tags[i]); |
| 328 | if(ev->x < x) { | 328 | if(ev->x > bgw && ev->x < x) { |
| 329 | if(ev->button == Button1) { | 329 | if(ev->button == Button1) { |
| 330 | if(ev->state & MODKEY) | 330 | if(ev->state & MODKEY) |
| 331 | tag(tags[i]); | 331 | tag(tags[i]); |
| @@ -514,6 +514,9 @@ drawbar(void) { | |||
| 514 | Client *c; | 514 | Client *c; |
| 515 | 515 | ||
| 516 | dc.x = 0; | 516 | dc.x = 0; |
| 517 | dc.w = bgw; | ||
| 518 | drawtext(geom->symbol, dc.norm, False); | ||
| 519 | dc.x += bgw; | ||
| 517 | for(c = stack; c && !isvisible(c); c = c->snext); | 520 | for(c = stack; c && !isvisible(c); c = c->snext); |
| 518 | for(i = 0; i < LENGTH(tags); i++) { | 521 | for(i = 0; i < LENGTH(tags); i++) { |
| 519 | dc.w = textw(tags[i]); | 522 | dc.w = textw(tags[i]); |
| @@ -854,7 +857,7 @@ unsigned int | |||
| 854 | idxoftag(const char *t) { | 857 | idxoftag(const char *t) { |
| 855 | unsigned int i; | 858 | unsigned int i; |
| 856 | 859 | ||
| 857 | for(i = 0; (i < LENGTH(tags)) && (tags[i] != t); i++); | 860 | for(i = 0; (i < LENGTH(tags)) && strcmp(tags[i], t); i++); |
| 858 | return (i < LENGTH(tags)) ? i : 0; | 861 | return (i < LENGTH(tags)) ? i : 0; |
| 859 | } | 862 | } |
| 860 | 863 | ||
| @@ -1501,6 +1504,11 @@ setup(void) { | |||
| 1501 | if(i > blw) | 1504 | if(i > blw) |
| 1502 | blw = i; | 1505 | blw = i; |
| 1503 | } | 1506 | } |
| 1507 | for(bgw = i = 0; i < LENGTH(geoms); i++) { | ||
| 1508 | i = textw(geoms[i].symbol); | ||
| 1509 | if(i > bgw) | ||
| 1510 | bgw = i; | ||
| 1511 | } | ||
| 1504 | 1512 | ||
| 1505 | wa.override_redirect = 1; | 1513 | wa.override_redirect = 1; |
| 1506 | wa.background_pixmap = ParentRelative; | 1514 | wa.background_pixmap = ParentRelative; |
