diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-05-15 14:10:04 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-05-15 14:10:04 +0530 |
commit | fc76456244d6bbd1d92b685b6e2c95411757943f (patch) | |
tree | 7c4c3130ec689a8355c367d69069a92d7356d883 /dwm.c | |
parent | b1684df06c97526e59a7d4a31695cde80bf6b948 (diff) |
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -165,6 +165,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); @@ -691,6 +692,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; |