~kris/suckless

dwm

ref: 9d111695d836f7a8edb2884da93497b488c57422 dwm/patch/cyclelayouts.c -rw-r--r-- 273 bytes
9d111695 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
void
cyclelayout(const Arg *arg)
{
	int i;
	int num_layouts = LENGTH(layouts);

	for (i = 0; i < num_layouts && &layouts[i] != selmon->lt[selmon->sellt]; i++);
	i += arg->i;
	setlayout(&((Arg) { .v = &layouts[(i % num_layouts + num_layouts) % num_layouts] })); // modulo
}