summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--config.def.h4
-rw-r--r--dwm.c13
2 files changed, 15 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h
index 8dee5e1..11993da 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,7 +12,7 @@
12#define SELFGCOLOR "#ffffff" 12#define SELFGCOLOR "#ffffff"
13 13
14/* old */ 14/* old */
15const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 15const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
16 16
17Rule rules[] = { 17Rule rules[] = {
18 /* class:instance:title substr tags ref isfloating */ 18 /* class:instance:title substr tags ref isfloating */
@@ -30,6 +30,7 @@ Layout layouts[] = {
30 /* symbol function */ 30 /* symbol function */
31 { "[]=", tile }, /* first entry is default */ 31 { "[]=", tile }, /* first entry is default */
32 { "><>", floating }, 32 { "><>", floating },
33 { "[M]", monocle },
33}; 34};
34 35
35/* key definitions */ 36/* key definitions */
@@ -46,6 +47,7 @@ Key keys[] = {
46 { MODKEY, XK_h, setmwfact, "-0.05" }, 47 { MODKEY, XK_h, setmwfact, "-0.05" },
47 { MODKEY, XK_l, setmwfact, "+0.05" }, 48 { MODKEY, XK_l, setmwfact, "+0.05" },
48 { MODKEY, XK_r, reapply, NULL }, 49 { MODKEY, XK_r, reapply, NULL },
50 { MODKEY, XK_m, setlayout, "[M]" },
49 { MODKEY, XK_Return, zoom, NULL }, 51 { MODKEY, XK_Return, zoom, NULL },
50 { MODKEY, XK_Tab, viewprevtag, NULL }, 52 { MODKEY, XK_Tab, viewprevtag, NULL },
51 { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, 53 { MODKEY|ShiftMask, XK_space, togglefloating, NULL },
diff --git a/dwm.c b/dwm.c
index 897eeb4..b417167 100644
--- a/dwm.c
+++ b/dwm.c
@@ -153,6 +153,7 @@ void killclient(const char *arg);
153void manage(Window w, XWindowAttributes *wa); 153void manage(Window w, XWindowAttributes *wa);
154void mappingnotify(XEvent *e); 154void mappingnotify(XEvent *e);
155void maprequest(XEvent *e); 155void maprequest(XEvent *e);
156void monocle(void);
156void movemouse(Client *c); 157void movemouse(Client *c);
157Client *nexttiled(Client *c); 158Client *nexttiled(Client *c);
158void propertynotify(XEvent *e); 159void propertynotify(XEvent *e);
@@ -1072,6 +1073,16 @@ maprequest(XEvent *e) {
1072} 1073}
1073 1074
1074void 1075void
1076monocle(void) {
1077 Client *c;
1078
1079 domwfact = dozoom = False;
1080 for(c = clients; c; c = c->next)
1081 if(isvisible(c))
1082 resize(c, wax, way, waw - 2 * c->border, wah - 2 * c->border, RESIZEHINTS);
1083}
1084
1085void
1075movemouse(Client *c) { 1086movemouse(Client *c) {
1076 int x1, y1, ocx, ocy, di, nx, ny; 1087 int x1, y1, ocx, ocy, di, nx, ny;
1077 unsigned int dui; 1088 unsigned int dui;
@@ -1412,7 +1423,7 @@ setlayout(const char *arg) {
1412 } 1423 }
1413 else { 1424 else {
1414 for(i = 0; i < LENGTH(layouts); i++) 1425 for(i = 0; i < LENGTH(layouts); i++)
1415 if(arg == layouts[i].symbol) 1426 if(!strcmp(arg, layouts[i].symbol))
1416 break; 1427 break;
1417 if(i == LENGTH(layouts)) 1428 if(i == LENGTH(layouts))
1418 return; 1429 return;