Adding cyclelayouts patch

This commit is contained in:
bakkeby
2019-09-07 22:27:06 +02:00
parent 27b6b4b024
commit 9ccc131284
7 changed files with 42 additions and 1 deletions

16
patch/cyclelayouts.c Normal file
View File

@@ -0,0 +1,16 @@
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] }));
}
}