-
-
Save noomz/3110540 to your computer and use it in GitHub Desktop.
Pomodoro timer for ubuntu unity
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
#!/usr/bin/env ruby | |
# | |
# Pomodoro script. | |
# | |
# Displays a notification after given minutes. | |
# Use pomodoro.rb with args 10 = 10 min, 10s = 10 seconds | |
# | |
# Don't forget to 'sudo apt-get install libnotify-bin' | |
# | |
system "notify-send -i face-cool 'Go go go!'" | |
min = ARGV[0].to_i | |
if /^\d+s$/.match(min.to_s) | |
min = min.to_s[0..-1] | |
sec = true | |
else | |
sec = false | |
end | |
min.times do |n| | |
puts min - n | |
sleep 60 if not sec unless sleep 1 | |
end | |
system "notify-send -i face-cool -t 0 'End of Pomodoro!'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment