monocle goes mainstream

keyboard
Anselm R Garbe 17 years ago
parent a82cba2759
commit 96ee9d888c
  1. 2
      config.def.h
  2. 13
      dwm.c

@ -30,6 +30,7 @@ Layout layouts[] = {
/* symbol function */ /* symbol function */
{ "[]=", tile }, /* first entry is default */ { "[]=", tile }, /* first entry is default */
{ "><>", floating }, { "><>", floating },
{ "[M]", monocle },
}; };
/* key definitions */ /* key definitions */
@ -46,6 +47,7 @@ Key keys[] = {
{ MODKEY, XK_h, setmwfact, "-0.05" }, { MODKEY, XK_h, setmwfact, "-0.05" },
{ MODKEY, XK_l, setmwfact, "+0.05" }, { MODKEY, XK_l, setmwfact, "+0.05" },
{ MODKEY, XK_r, reapply, NULL }, { MODKEY, XK_r, reapply, NULL },
{ MODKEY, XK_m, setlayout, "[M]" },
{ MODKEY, XK_Return, zoom, NULL }, { MODKEY, XK_Return, zoom, NULL },
{ MODKEY, XK_Tab, viewprevtag, NULL }, { MODKEY, XK_Tab, viewprevtag, NULL },
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, { MODKEY|ShiftMask, XK_space, togglefloating, NULL },

13
dwm.c

@ -153,6 +153,7 @@ void killclient(const char *arg);
void manage(Window w, XWindowAttributes *wa); void manage(Window w, XWindowAttributes *wa);
void mappingnotify(XEvent *e); void mappingnotify(XEvent *e);
void maprequest(XEvent *e); void maprequest(XEvent *e);
void monocle(void);
void movemouse(Client *c); void movemouse(Client *c);
Client *nexttiled(Client *c); Client *nexttiled(Client *c);
void propertynotify(XEvent *e); void propertynotify(XEvent *e);
@ -1071,6 +1072,16 @@ maprequest(XEvent *e) {
manage(ev->window, &wa); manage(ev->window, &wa);
} }
void
monocle(void) {
Client *c;
domwfact = dozoom = False;
for(c = clients; c; c = c->next)
if(isvisible(c))
resize(c, wax, way, waw - 2 * c->border, wah - 2 * c->border, RESIZEHINTS);
}
void void
movemouse(Client *c) { movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny; int x1, y1, ocx, ocy, di, nx, ny;
@ -1412,7 +1423,7 @@ setlayout(const char *arg) {
} }
else { else {
for(i = 0; i < LENGTH(layouts); i++) for(i = 0; i < LENGTH(layouts); i++)
if(arg == layouts[i].symbol) if(!strcmp(arg, layouts[i].symbol))
break; break;
if(i == LENGTH(layouts)) if(i == LENGTH(layouts))
return; return;

Loading…
Cancel
Save