diff options
author | dfuehrer <dfuehrer@email.arizona.edu> | 2021-03-13 23:34:15 -0700 |
---|---|---|
committer | dfuehrer <dfuehrer@email.arizona.edu> | 2021-03-13 23:34:15 -0700 |
commit | 1697346729c8e8d1c6b3bcf08cd8fdd3e3886a3e (patch) | |
tree | c2fbef11580e73c5307241634b4e23c77cab3eba /dwmblocks.c | |
parent | sorta fixed bug with sleep and timing where interrupting (diff) | |
parent | Merge pull request #66 from LukeSmithxyz/revert-62-fast-scrolling-fix (diff) | |
download | dwmblocks-1697346729c8e8d1c6b3bcf08cd8fdd3e3886a3e.tar.gz dwmblocks-1697346729c8e8d1c6b3bcf08cd8fdd3e3886a3e.tar.bz2 dwmblocks-1697346729c8e8d1c6b3bcf08cd8fdd3e3886a3e.tar.xz dwmblocks-1697346729c8e8d1c6b3bcf08cd8fdd3e3886a3e.tar.zst dwmblocks-1697346729c8e8d1c6b3bcf08cd8fdd3e3886a3e.zip |
merged with master
Diffstat (limited to 'dwmblocks.c')
-rw-r--r-- | dwmblocks.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dwmblocks.c b/dwmblocks.c index 1d31a65..26ca6b0 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -114,6 +114,10 @@ void getsigcmds(int signal) void setupsignals() { struct sigaction sa; + + for(int i = SIGRTMIN; i <= SIGRTMAX; i++) + signal(i, SIG_IGN); + for(int i = 0; i < LENGTH(blocks); i++) { if (blocks[i].signal > 0) @@ -210,6 +214,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) { @@ -220,14 +225,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 |