dwm/patch/cyclelayouts.c

19 lines
424 B
C
Raw Normal View History

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