~kris/suckless

dwm

ref: 84e42e3f9c46592fbb5f9c376caa5ea082788ebf dwm/patch/cyclelayouts.c -rw-r--r-- 273 bytes
84e42e3f — Kris Yotam Restore Mod+s/Print snip and record bindings 3 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
}