Adding cyclelayouts patch
This commit is contained in:
16
patch/cyclelayouts.c
Normal file
16
patch/cyclelayouts.c
Normal 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] }));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user