commit e682d740adb7bb36b9faca1ca1cc54b7c5448e6c Author: Mart Lubbers <m...@martlubbers.net> AuthorDate: Thu Jun 18 08:46:12 2020 +0200 Commit: Aaron Marcher <m...@drkhsh.at> CommitDate: Mon Nov 30 19:04:14 2020 +0100
Handle SIGUSR1 for forced refreshes At some point one might want to force a refresh for example after checking email or changing the volume. Sending a SIGUSR1 achieves this now diff --git a/slstatus.c b/slstatus.c index 96fa5b6..499cd30 100644 --- a/slstatus.c +++ b/slstatus.c @@ -26,9 +26,8 @@ static Display *dpy; static void terminate(const int signo) { - (void)signo; - - done = 1; + if (signo != SIGUSR1) + done = 1; } static void @@ -72,6 +71,7 @@ main(int argc, char *argv[]) act.sa_handler = terminate; sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); + sigaction(SIGUSR1, &act, NULL); if (!sflag && !(dpy = XOpenDisplay(NULL))) { die("XOpenDisplay: Failed to open display");