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
You've commented your problem already.
while(1); // busy wait's bad, I know, but easy to implement
The above is almost ALWAYS a bad idea.
NSDistributedNotificationCenter actually requires a running main thread NSRunLoop to operate.
http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Notifications/Articles/NotificationCenters.html#//apple_ref/doc/uid/20000216-BAJGDAFC
Creating and spinning a run loop from the main() of a command line application on OS X is a fairly simple thing to do. There are plenty of examples available with a quick search.