From b1427dd169fa27607a348cc6aae394c327ba562f Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 4 Dec 2018 15:38:22 -0500 Subject: Send only SIGHUP in sandman --- event.c | 4 +++- sandman.1 | 12 ++++-------- sandman.m | 14 +------------- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/event.c b/event.c index 444e7df..4ea9f81 100644 --- a/event.c +++ b/event.c @@ -120,6 +120,7 @@ noreturn void eventLoop(void) { }; sigaction(SIGCHLD, &action, NULL); sigaction(SIGINT, &action, NULL); + sigaction(SIGHUP, &action, NULL); struct sigaction curses; sigaction(SIGWINCH, &action, &curses); @@ -130,6 +131,7 @@ noreturn void eventLoop(void) { for (;;) { if (sig[SIGCHLD]) childWait(); + if (sig[SIGHUP]) ircFmt("QUIT :zzz\r\n"); if (sig[SIGINT]) { signal(SIGINT, SIG_DFL); ircFmt("QUIT :Goodbye\r\n"); @@ -139,7 +141,7 @@ noreturn void eventLoop(void) { uiRead(); uiDraw(); } - sig[SIGCHLD] = sig[SIGINT] = sig[SIGWINCH] = 0; + sig[SIGCHLD] = sig[SIGHUP] = sig[SIGINT] = sig[SIGWINCH] = 0; struct pollfd fds[3] = { { .events = POLLIN, .fd = irc }, diff --git a/sandman.1 b/sandman.1 index 0f6606b..2cdd70b 100644 --- a/sandman.1 +++ b/sandman.1 @@ -16,14 +16,10 @@ is a utility for Darwin systems. It runs the .Ar command as a child process -and sends it -.Dv SIGTSTP -and -.Dv SIGCONT -signals -when the system goes to sleep -and wakes from sleep, -respectively. +and sends it the +.Dv SIGHUP +signal +when the system goes to sleep. . .Sh EXIT STATUS .Nm diff --git a/sandman.m b/sandman.m index e8163c0..cc8bcc9 100644 --- a/sandman.m +++ b/sandman.m @@ -59,19 +59,7 @@ int main(int argc, char *argv[]) { queue: nil usingBlock: ^(NSNotification *note) { (void)note; - int error = kill(pid, SIGTSTP); - if (error) err(EX_UNAVAILABLE, "kill %d", pid); - } - ]; - - [ - [[NSWorkspace sharedWorkspace] notificationCenter] - addObserverForName: NSWorkspaceDidWakeNotification - object: nil - queue: nil - usingBlock: ^(NSNotification *note) { - (void)note; - int error = kill(pid, SIGCONT); + int error = kill(pid, SIGHUP); if (error) err(EX_UNAVAILABLE, "kill %d", pid); } ]; -- cgit 1.4.0 c/log/bin/man1/when.1?id=81eb4e68c561c7d0a32c294db652cea26dfa40d4&follow=1'>when.1 (unfollow)
Commit message (Expand)Author
2021-02-08Use 4M- for window resizing in cwmJune McEnroe
2021-02-08Tweak trackpad scaling, mouse accelerationJune McEnroe
2021-02-08Use xsel in up and add it do install.shJune McEnroe
2021-02-07Swap root window coloursJune McEnroe
2021-02-07Add -X flag to install X stuff on OpenBSDJune McEnroe
2021-02-07Adjust brightness by smaller incrementsJune McEnroe
2021-02-07Fix cwm window cycling, move big by defaultJune McEnroe
2021-02-07Use class names for Foreground, Background, BorderColorJune McEnroe
2021-02-07Add simple battery status and clock to xsessionJune McEnroe
2021-02-07Set cursor theme and sizeJune McEnroe
2021-02-07Use scrot for up -s if no screencaptureJune McEnroe
2021-02-07Enable mouse acceleration in XJune McEnroe
2021-02-07Set colours for Xt and cwmJune McEnroe
2021-02-07Set urgency on bell in xtermJune McEnroe
2021-02-07Add bindings for brightness controlJune McEnroe
2021-02-07Set X key repeat rateJune McEnroe
2021-02-07Bump font size to 12June McEnroe
2021-02-07Fully configure and rebind cwmJune McEnroe
2021-02-07Add BintiJune McEnroe
2021-02-07Finish configuring xtermJune McEnroe
2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe
2021-02-06Set root window to black on purple snowJune McEnroe
2021-02-06Add xmodmap configurationJune McEnroe
2021-02-06Add initial OpenBSD X configurationJune McEnroe
2021-02-06Add xterm output to schemeJune McEnroe