diff options
| -rw-r--r-- | README | 7 | ||||
| -rw-r--r-- | config.def.h | 2 | ||||
| -rw-r--r-- | dwm.1 | 6 | ||||
| -rw-r--r-- | dwm.c | 18 |
4 files changed, 30 insertions, 3 deletions
@@ -5,9 +5,10 @@ dwm is an extremely fast, small, and dynamic window manager for X. Patches Applied --------------- -pertag - https://dwm.suckless.org/patches/pertag/dwm-pertag-20200914-61bb8b2.diff -vanitygaps - https://dwm.suckless.org/patches/vanitygaps/dwm-cfacts-vanitygaps-6.4_combo.diff -movestack - https://dwm.suckless.org/patches/movestack/dwm-movestack-20211115-a786211.diff +pertag - https://dwm.suckless.org/patches/pertag/dwm-pertag-20200914-61bb8b2.diff +vanitygaps - https://dwm.suckless.org/patches/vanitygaps/dwm-cfacts-vanitygaps-6.4_combo.diff +movestack - https://dwm.suckless.org/patches/movestack/dwm-movestack-20211115-a786211.diff +cyclelayouts - https://dwm.suckless.org/patches/cyclelayouts/dwm-cyclelayouts-20180524-6.2.diff Requirements ------------ diff --git a/config.def.h b/config.def.h index e30ea3c..6ec5964 100644 --- a/config.def.h +++ b/config.def.h @@ -119,6 +119,8 @@ static const Key keys[] = { { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } }, + { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, @@ -92,6 +92,12 @@ Sets monocle layout. .B Mod1\-space Toggles between current and previous layout. .TP +.B Mod1\-Control\-, +Cycles backwards in layout list. +.TP +.B Mod1\-Control\-. +Cycles forwards in layout list. +.TP .B Mod1\-j Focus next window. .TP @@ -163,6 +163,7 @@ static void configure(Client *c); static void configurenotify(XEvent *e); static void configurerequest(XEvent *e); static Monitor *createmon(void); +static void cyclelayout(const Arg *arg); static void destroynotify(XEvent *e); static void detach(Client *c); static void detachstack(Client *c); @@ -683,6 +684,23 @@ createmon(void) } void +cyclelayout(const Arg *arg) { + Layout *l; + for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++); + if(arg->i > 0) { + if(l->symbol && (l + 1)->symbol) + setlayout(&((Arg) { .v = (l + 1) })); + else + setlayout(&((Arg) { .v = layouts })); + } else { + if(l != layouts && (l - 1)->symbol) + setlayout(&((Arg) { .v = (l - 1) })); + else + setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] })); + } +} + +void destroynotify(XEvent *e) { Client *c; |
