mirror of
https://git.sr.ht/~coasteen/dotfiles
synced 2026-02-06 15:13:45 +01:00
19 lines
273 B
C
19 lines
273 B
C
|
|
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] }));
|
||
|
|
}
|
||
|
|
|