Created
April 19, 2013 03:39
-
-
Save jugyo/5417982 to your computer and use it in GitHub Desktop.
earthquake.gem plugin to start screensaver remotely!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
Earthquake.init do | |
_ = config[:screensaver] ||= {} | |
_[:pattern] ||= /screen ?saver|スクリーンセーバー/i | |
_[:command] ||= %(open -a /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app) | |
output_filter do |item| | |
next unless item["_stream"] && item["text"] | |
next unless item["user"]["screen_name"] == twitter.info["screen_name"] | |
if item["text"] =~ _[:pattern] | |
puts 'Starting Screen Saver…'.c(:info) | |
system _[:command] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment