diff options
-rw-r--r-- | config.h | 32 | ||||
-rw-r--r-- | dwmblocks.c | 7 |
2 files changed, 4 insertions, 35 deletions
diff --git a/config.h b/config.h deleted file mode 100644 index ceb2c38..0000000 --- a/config.h +++ /dev/null @@ -1,32 +0,0 @@ -//Modify this file to change what commands output to your statusbar, and recompile using the make command. -static const Block blocks[] = { - /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ - /* {"", "cat /tmp/recordingicon 2>/dev/null", 0, 9}, */ - {"", "music", 0, 11}, - {"", "pacpackages", 0, 8}, - {"", "news", 0, 6}, - /* {"", "crypto", 0, 13}, */ - /* {"", "price bat \"Basic Attention Token\" 🦁", 0, 20}, */ - /* {"", "price btc Bitcoin 💰", 0, 21}, */ - /* {"", "price lbc \"LBRY Token\" 📚", 0, 22}, */ - {"", "torrent", 20, 7}, - {"", "memory", 10, 14}, - {"", "cpu", 10, 18}, - /* {"", "moonphase", 18000, 17}, */ - /* {"", "weather", 18000, 5}, */ - {"", "mailbox", 180, 12}, - /* {"", "nettraf", 1, 16}, */ - {"", "volume", 0, 10}, - {"", "battery", 5, 3}, - {"", "clock", 60, 1}, - /* {"", "internet", 5, 4}, */ - /* {"", "help-icon", 0, 15} */ -}; - -//sets delimeter between status commands. NULL character ('\0') means no delimeter. -static char *delim = " "; - -// Have dwmblocks automatically recompile and run when you edit this file in -// vim with the following line in your vimrc/init.vim: - -// autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks & } 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 |