~kris/suckless

dwm

ref: ecba1fc15a4e33ba4b00e04f8f047170019d7f2f dwm/patch/bar_layoutmenu.c -rw-r--r-- 273 bytes
ecba1fc1 — Kris Yotam enable FLEXTILE_DELUXE_LAYOUT for RRR reading mode (3 vertical panes) 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void
layoutmenu(const Arg *arg) {
	FILE *p;
	char c[3], *s;
	int i;

	if (!(p = popen(layoutmenu_cmd, "r")))
		 return;
	s = fgets(c, sizeof(c), p);
	pclose(p);

	if (!s || *s == '\0' || c[0] == '\0')
		 return;

	i = atoi(c);
	setlayout(&((Arg) { .v = &layouts[i] }));
}