问题 I want to monitor screensaver and lockscreen events on an OSX box. As a first pass, I'm fine with them just printing to the console. Following the advice of another's question, I wrote some Objective C to listen for Cocoa Notifications for the com.apple.screensaver.didstart , com.apple.screensaver.didstop , com.apple.screenIsLocked , and com.apple.screenIsUnlocked events. // ScreenSaverMonitor.h #import <Foundation/NSObject.h> #import <Foundation/NSNotification.h> @interface