~kris/suckless

dwm

ref: 99a17f8a00f1d4c2de62b1115db338207ddce547 dwm/patch/cyclelayouts.c -rw-r--r-- 273 bytes
99a17f8a — Kris Yotam Rebind application keys to dmenu scripts and add reading mode layout 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
}