diff --git a/README.md b/README.md index 9c70f22..ff2c4ab 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: -2019-10-24 - Added dragmfact and extrabar patches +2019-10-24 - Added dragmfact, extrabar and nodmenu patches 2019-10-22 - Added ispermanent and swallow patches @@ -202,6 +202,10 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - [noborder](https://dwm.suckless.org/patches/noborder/) - removes the border when there is only one window visible + - [nodmenu](https://dwm.suckless.org/patches/nodmenu/) + - enable modifying dmenu in config.def.h which resulted previously in a compilation error because two lines of code hardcode dmenu into dwm + - allows complete removal of dmenu, should you want to do that + - [onlyquitonempty](https://dwm.suckless.org/patches/onlyquitonempty/) - makes it so dwm will only exit via quit() if no windows are open (in order to prevent accidental loss of work) diff --git a/config.def.h b/config.def.h index 73c0164..9aeee95 100644 --- a/config.def.h +++ b/config.def.h @@ -488,8 +488,12 @@ static const Layout layouts[] = { #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } /* commands */ +#if NODMENU_PATCH +static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; +#else static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; +#endif static const char *termcmd[] = { "st", NULL }; #if SCRATCHPAD_PATCH diff --git a/dwm.c b/dwm.c index 629d3f8..274c36c 100644 --- a/dwm.c +++ b/dwm.c @@ -2929,8 +2929,10 @@ sigchld(int unused) void spawn(const Arg *arg) { + #if !NODMENU_PATCH if (arg->v == dmenucmd) dmenumon[0] = '0' + selmon->num; + #endif // NODMENU_PATCH #if SCRATCHPAD_PATCH selmon->tagset[selmon->seltags] &= ~scratchtag; #endif // SCRATCHPAD_PATCH diff --git a/patches.h b/patches.h index 33db1b1..d9b3d03 100644 --- a/patches.h +++ b/patches.h @@ -282,6 +282,12 @@ */ #define NOBORDER_PATCH 0 +/* Enable modifying or removing dmenu in config.def.h which resulted previously in a + * compilation error because two lines of code hardcode dmenu into dwm. + * https://dwm.suckless.org/patches/nodmenu/ + */ +#define NODMENU_PATCH 0 + /* This patch makes it so dwm will only exit via quit() if no windows are open. * This is to prevent you accidentally losing all your work. * https://dwm.suckless.org/patches/onlyquitonempty/