Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (19 sloc) 502 Bytes
#!/usr/bin/env macruby
framework 'appkit'
class NotificationListener
def self.registered_listeners
@registered_listeners ||= []
end
def initialize
NotificationListener.registered_listeners << self
NSNotificationCenter.defaultCenter.addObserver self,
selector:'receive:',
name:NSApplicationDidChangeScreenParametersNotification,
object:NSApp
end
def receive(notification)
p notification.description
end
end
NotificationListener.new
NSApp.run