diff options
| author | bakkeby <[email protected]> | 2020-05-05 19:50:28 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-05-05 19:50:28 +0200 |
| commit | 91291ceb9f1c06d9c560b124f42dd4b3b68190a9 (patch) | |
| tree | 8f41cd83429bea5271e4d1ce58b73160738ffc43 | |
| parent | 75d5f1e0c5140bb97ebb77db66462d7a86da9450 (diff) | |
| download | dwm-flexipatch-91291ceb9f1c06d9c560b124f42dd4b3b68190a9.tar.gz dwm-flexipatch-91291ceb9f1c06d9c560b124f42dd4b3b68190a9.zip | |
Removing redundant statuscmds logic when both statuscmd and dwmblocks patches are applied
| -rw-r--r-- | config.def.h | 4 | ||||
| -rw-r--r-- | dwm.c | 12 | ||||
| -rw-r--r-- | patch/statuscmd.c | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/config.def.h b/config.def.h index b72d587..d7b4572 100644 --- a/config.def.h +++ b/config.def.h @@ -690,11 +690,11 @@ static const char *dmenucmd[] = { }; static const char *termcmd[] = { "st", NULL }; -#if STATUSCMD_PATCH +#if STATUSCMD_PATCH && !DWMBLOCKS_PATCH /* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */ static const char *statuscmds[] = { "notify-send Mouse$BUTTON" }; static char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL }; -#endif // STATUSCMD_PATCH +#endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH #if SCRATCHPAD_ALT_1_PATCH static const unsigned scratchpad_mask = 1u << sizeof tags / sizeof * tags; @@ -3184,14 +3184,14 @@ sigchld(int unused) void spawn(const Arg *arg) { - #if STATUSCMD_PATCH + #if STATUSCMD_PATCH && !DWMBLOCKS_PATCH char *cmd = NULL; - #endif // STATUSCMD_PATCH + #endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH #if !NODMENU_PATCH if (arg->v == dmenucmd) dmenumon[0] = '0' + selmon->num; #endif // NODMENU_PATCH - #if STATUSCMD_PATCH + #if STATUSCMD_PATCH && !DWMBLOCKS_PATCH #if !NODMENU_PATCH else if (arg->v == statuscmd) #else @@ -3206,7 +3206,7 @@ spawn(const Arg *arg) cmd[LENGTH(statusexport)-3] = '0' + lastbutton; statuscmd[2] = cmd; } - #endif // STATUSCMD_PATCH + #endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH if (fork() == 0) { if (dpy) @@ -3251,9 +3251,9 @@ spawn(const Arg *arg) perror(" failed"); exit(EXIT_SUCCESS); } - #if STATUSCMD_PATCH + #if STATUSCMD_PATCH && !DWMBLOCKS_PATCH free(cmd); - #endif // STATUSCMD_PATCH + #endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH } void diff --git a/patch/statuscmd.c b/patch/statuscmd.c index 2264451..9a7c938 100644 --- a/patch/statuscmd.c +++ b/patch/statuscmd.c @@ -1,6 +1,8 @@ static char rawstext[256]; static const char statusexport[] = "export BUTTON=-;"; +#if !DWMBLOCKS_PATCH static int statuscmdn; +#endif // DWMBLOCKS_PATCH static int lastbutton; void @@ -14,4 +16,4 @@ copyvalidchars(char *text, char *rawtext) } } text[j] = '\0'; -}
\ No newline at end of file +} |
