summaryrefslogtreecommitdiff
path: root/dwmblocks.c
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-08-28 19:27:12 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-08-28 19:27:12 -0400
commit7524ccd1e5eb69ab177cb7f0bc4044994464be6e (patch)
tree85cf3aeed1abd28647079a16d455c947bacb7ac4 /dwmblocks.c
parent8b313712dc8000ce65b229e3089f429bc9fc8cd9 (diff)
downloaddwmblocks-7524ccd1e5eb69ab177cb7f0bc4044994464be6e.tar.gz
dwmblocks-7524ccd1e5eb69ab177cb7f0bc4044994464be6e.tar.bz2
dwmblocks-7524ccd1e5eb69ab177cb7f0bc4044994464be6e.zip
update and fork fix
Diffstat (limited to 'dwmblocks.c')
-rw-r--r--dwmblocks.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dwmblocks.c b/dwmblocks.c
index d135a7d..68267d7 100644
--- a/dwmblocks.c
+++ b/dwmblocks.c
@@ -193,6 +193,7 @@ void sighandler(int signum)
void buttonhandler(int sig, siginfo_t *si, void *ucontext)
{
char button[2] = {'0' + si->si_value.sival_int & 0xff, '\0'};
+ pid_t process_id = getpid();
sig = si->si_value.sival_int >> 8;
if (fork() == 0)
{
@@ -203,14 +204,14 @@ void buttonhandler(int sig, siginfo_t *si, void *ucontext)
if (current->signal == sig)
break;
}
- char *command[] = { "/bin/sh", "-c", current->command, NULL };
+ char shcmd[1024];
+ sprintf(shcmd,"%s && kill -%d %d",current->command, current->signal+34,process_id);
+ char *command[] = { "/bin/sh", "-c", shcmd, NULL };
setenv("BLOCK_BUTTON", button, 1);
setsid();
execvp(command[0], command);
exit(EXIT_SUCCESS);
}
- getsigcmds(sig);
- writestatus();
}
#endif
Software created with 💖