about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sandman.m45
1 files changed, 23 insertions, 22 deletions
diff --git a/sandman.m b/sandman.m
index 12a4817..7d2f56a 100644
--- a/sandman.m
+++ b/sandman.m
@@ -40,33 +40,34 @@ int main(int argc, char *argv[]) {
 
 	pid_t pid = fork();
 	if (pid < 0) err(EX_OSERR, "fork");
-
 	if (!pid) {
 		execvp(argv[1], &argv[1]);
 		err(EX_NOINPUT, "%s", argv[1]);
 	}
 
-	NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
-	NSNotificationCenter *center = [workspace notificationCenter];
-	NSOperationQueue *main = [NSOperationQueue mainQueue];
-
-	[center addObserverForName:NSWorkspaceWillSleepNotification
-						object:nil
-						 queue:main
-					usingBlock:^(NSNotification *note) {
-						(void)note;
-						int error = kill(pid, SIGTSTP);
-						if (error) err(EX_UNAVAILABLE, "kill %d", pid);
-					}];
-
-	[center addObserverForName:NSWorkspaceDidWakeNotification
-						object:nil
-						 queue:main
-					usingBlock:^(NSNotification *note) {
-						(void)note;
-						int error = kill(pid, SIGCONT);
-						if (error) err(EX_UNAVAILABLE, "kill %d", pid);
-					}];
+	[
+		[[NSWorkspace sharedWorkspace] notificationCenter]
+		addObserverForName: NSWorkspaceWillSleepNotification
+		object: nil
+		queue: [NSOperationQueue mainQueue]
+		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: [NSOperationQueue mainQueue]
+		usingBlock: ^(NSNotification *note) {
+			(void)note;
+			int error = kill(pid, SIGCONT);
+			if (error) err(EX_UNAVAILABLE, "kill %d", pid);
+		}
+	];
 
 	[[NSApplication sharedApplication] run];
 }
ver-highlight'> 2020-02-12Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe Wow. One of the best I've read. 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe Broke out LDLIBS for each bin, and made everything more uniform. 2020-01-28Change scout sensitivity to 1.4June McEnroe idk it seems to work. 2020-01-28Import shows.txtJune McEnroe