Created
August 18, 2011 05:58
-
-
Save alunny/1153401 to your computer and use it in GitHub Desktop.
have adium running while I'm at work
This file contains hidden or 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
| require 'rubygems' | |
| require 'appscript' # using 0.6.1 | |
| adium = Appscript.app "adium" | |
| return unless adium.is_running? | |
| accnts = adium.accounts.get | |
| work_accnt = accnts.find { |acc| acc.name.get == "[email protected]" } | |
| now = Time.new | |
| day = now.wday | |
| weekend = day == 0 or day == 6 | |
| hour = now.hour | |
| lunnys_time = hour < 9 || hour > 17 | |
| if weekend or lunnys_time | |
| adium.go_offline work_accnt | |
| else | |
| adium.go_online work_accnt | |
| end |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd > | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.alunny.adiumscript</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/bin/ruby</string> | |
| <string>/Users/alunny/bin/adiumscript.rb</string> | |
| </array> | |
| <key>StartInterval</key> | |
| <integer>900</integer> | |
| </dict> | |
| </plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment