Skip to content

Instantly share code, notes, and snippets.

@ngauthier
Created June 16, 2010 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ngauthier/441266 to your computer and use it in GitHub Desktop.
Save ngauthier/441266 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def notify(msg)
puts "NOTIFY: #{msg}"
`notify-send -i /home/nick/bin/nicks-toolbox/pom.png "Pomodoro" "#{msg}"`
end
unless ARGV.size == 2
puts "Usage: pomodoro <work time> <rest time>"
exit(1)
end
POMODORO = ARGV[0].to_i
REST = ARGV[1].to_i
notify "time to flow"
1.upto(POMODORO) do |minute|
sleep 60
puts "#{minute}/#{POMODORO}"
if minute % 5 == 0
notify "#{minute}/#{POMODORO}"
end
if minute == (POMODORO-1)
notify "One minute left!"
end
end
`rhythmbox-client --pause`
`gnome-screensaver-command -a`
sleep REST * 60
`gnome-screensaver-command -d`
notify "Welcome Back"
@jszmajda
Copy link

I love how this script is all "GTFO"

@ngauthier
Copy link
Author

Yup. Complete lockdown.

@ngauthier
Copy link
Author

I'm using this image for pom.png

http://s4.appbrain.com/icon?id=6009285061288013211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment