added layoutmenu patch

This commit is contained in:
matt 2021-01-02 01:24:03 +01:00
parent acbf2de1c2
commit 44ea8f5cce
3 changed files with 27 additions and 0 deletions

18
patch/bar_layoutmenu.c Normal file
View File

@ -0,0 +1,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')
return;
i = atoi(c);
setlayout(&((Arg) { .v = &layouts[i] }));
}

1
patch/bar_layoutmenu.h Normal file
View File

@ -0,0 +1 @@
static void layoutmenu(const Arg *arg);

8
patch/layoutmenu.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
cat <<EOF | xmenu
[]= Tiled Layout 0
><> Floating Layout 1
[M] Monocle Layout 2
EOF