Revert "Remove dmenumon variable"
authorHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 28 Oct 2022 14:37:56 +0000 (16:37 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 28 Oct 2022 14:37:56 +0000 (16:37 +0200)
This reverts commit c2b748e7931e5f28984efc236f9b1a212dbc65e8.

Revert back this change. It seems to not be an edge-case anymore since
multiple users have asked about this new behaviour now.

config.def.h
dwm.c

index 061ad662f82a56067b71c2dec49b16a36cd3fbfb..9efa7744b39c8b0ff0cf09a504a2539910c2881c 100644 (file)
@@ -56,7 +56,8 @@ static const Layout layouts[] = {
 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
 
 /* commands */
-static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
 static const char *termcmd[]  = { "st", NULL };
 
 static const Key keys[] = {
diff --git a/dwm.c b/dwm.c
index e5efb6a22806852fe823677b3a21acde19d88610..253aba7b6f7d7185d00cb939f68298026f1ae931 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -1639,6 +1639,8 @@ sigchld(int unused)
 void
 spawn(const Arg *arg)
 {
+       if (arg->v == dmenucmd)
+               dmenumon[0] = '0' + selmon->num;
        if (fork() == 0) {
                if (dpy)
                        close(ConnectionNumber(dpy));