dwm-flexipatch/patch/cyclelayouts.c

18 lines
423 B
C
Raw Normal View History

2019-09-07 20:27:06 +00:00
void
2019-09-10 22:51:37 +00:00
cyclelayout(const Arg *arg)
{
2019-09-07 20:27:06 +00:00
Layout *l;
2019-09-10 22:51:37 +00:00
for (l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++);
if (arg->i > 0) {
if (l->symbol && (l + 1)->symbol)
2019-09-07 20:27:06 +00:00
setlayout(&((Arg) { .v = (l + 1) }));
else
setlayout(&((Arg) { .v = layouts }));
} else {
2019-09-10 22:51:37 +00:00
if (l != layouts && (l - 1)->symbol)
2019-09-07 20:27:06 +00:00
setlayout(&((Arg) { .v = (l - 1) }));
else
setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] }));
}
2019-09-10 22:51:37 +00:00
}