Created
May 27, 2010 13:27
-
-
Save rolandoam/415792 to your computer and use it in GitHub Desktop.
timer
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
#!/usr/bin/ruby | |
GROWLNOTIFY = "/Users/rolando/Applications/growlnotify" | |
ALERT_SOUND = "/Users/rolando/Documents/GFF/SFX/alert_35.wav" | |
class Fixnum | |
def minutes | |
self * 60 | |
end | |
end | |
ok_to_go = true | |
Signal.trap("INT") do | |
puts "terminating..." | |
exit(0) | |
end | |
5.times do | |
system "/usr/bin/afplay '#{ALERT_SOUND}'" | |
system "'#{GROWLNOTIFY}' -m 'start working, biatch!' 2> /dev/null" | |
sleep 12.minutes | |
system "/usr/bin/afplay '#{ALERT_SOUND}'" | |
system "'#{GROWLNOTIFY}' -m 'ok, now some rest' 2> /dev/null" | |
sleep 3.minutes | |
end | |
system "/usr/bin/afplay '#{ALERT_SOUND}'" | |
system "'#{GROWLNOTIFY}' -m 'good job!' 2> /dev/null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment