mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Removing redundant statuscmds logic when both statuscmd and dwmblocks patches are applied
This commit is contained in:
parent
75d5f1e0c5
commit
91291ceb9f
@ -690,11 +690,11 @@ static const char *dmenucmd[] = {
|
|||||||
};
|
};
|
||||||
static const char *termcmd[] = { "st", NULL };
|
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 */
|
/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
|
||||||
static const char *statuscmds[] = { "notify-send Mouse$BUTTON" };
|
static const char *statuscmds[] = { "notify-send Mouse$BUTTON" };
|
||||||
static char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
|
static char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
|
||||||
#endif // STATUSCMD_PATCH
|
#endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH
|
||||||
|
|
||||||
#if SCRATCHPAD_ALT_1_PATCH
|
#if SCRATCHPAD_ALT_1_PATCH
|
||||||
static const unsigned scratchpad_mask = 1u << sizeof tags / sizeof * tags;
|
static const unsigned scratchpad_mask = 1u << sizeof tags / sizeof * tags;
|
||||||
|
12
dwm.c
12
dwm.c
@ -3184,14 +3184,14 @@ sigchld(int unused)
|
|||||||
void
|
void
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
#if STATUSCMD_PATCH
|
#if STATUSCMD_PATCH && !DWMBLOCKS_PATCH
|
||||||
char *cmd = NULL;
|
char *cmd = NULL;
|
||||||
#endif // STATUSCMD_PATCH
|
#endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH
|
||||||
#if !NODMENU_PATCH
|
#if !NODMENU_PATCH
|
||||||
if (arg->v == dmenucmd)
|
if (arg->v == dmenucmd)
|
||||||
dmenumon[0] = '0' + selmon->num;
|
dmenumon[0] = '0' + selmon->num;
|
||||||
#endif // NODMENU_PATCH
|
#endif // NODMENU_PATCH
|
||||||
#if STATUSCMD_PATCH
|
#if STATUSCMD_PATCH && !DWMBLOCKS_PATCH
|
||||||
#if !NODMENU_PATCH
|
#if !NODMENU_PATCH
|
||||||
else if (arg->v == statuscmd)
|
else if (arg->v == statuscmd)
|
||||||
#else
|
#else
|
||||||
@ -3206,7 +3206,7 @@ spawn(const Arg *arg)
|
|||||||
cmd[LENGTH(statusexport)-3] = '0' + lastbutton;
|
cmd[LENGTH(statusexport)-3] = '0' + lastbutton;
|
||||||
statuscmd[2] = cmd;
|
statuscmd[2] = cmd;
|
||||||
}
|
}
|
||||||
#endif // STATUSCMD_PATCH
|
#endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH
|
||||||
|
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
if (dpy)
|
if (dpy)
|
||||||
@ -3251,9 +3251,9 @@ spawn(const Arg *arg)
|
|||||||
perror(" failed");
|
perror(" failed");
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
#if STATUSCMD_PATCH
|
#if STATUSCMD_PATCH && !DWMBLOCKS_PATCH
|
||||||
free(cmd);
|
free(cmd);
|
||||||
#endif // STATUSCMD_PATCH
|
#endif // STATUSCMD_PATCH | DWMBLOCKS_PATCH
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
static char rawstext[256];
|
static char rawstext[256];
|
||||||
static const char statusexport[] = "export BUTTON=-;";
|
static const char statusexport[] = "export BUTTON=-;";
|
||||||
|
#if !DWMBLOCKS_PATCH
|
||||||
static int statuscmdn;
|
static int statuscmdn;
|
||||||
|
#endif // DWMBLOCKS_PATCH
|
||||||
static int lastbutton;
|
static int lastbutton;
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -14,4 +16,4 @@ copyvalidchars(char *text, char *rawtext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
text[j] = '\0';
|
text[j] = '\0';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user