~kris/suckless

dwm

ref: 817b9a60d284bd45efe0718a158d2b2bedb2d730 dwm/patch/cyclelayouts.c -rw-r--r-- 273 bytes
817b9a60 — Kris Yotam Restore original README style with flexipatch updates 7 months 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
}