Skip to content

Instantly share code, notes, and snippets.

@tsu-nera
Created February 1, 2014 05:08
Show Gist options
  • Save tsu-nera/8748283 to your computer and use it in GitHub Desktop.
Save tsu-nera/8748283 to your computer and use it in GitHub Desktop.
pomodor timer
#!/usr/bin/env ruby
# coding: utf-8
def check_usage
unless ARGV.length == 1
puts "USAGE pomo -b:5min timer start"
puts "USAGE pomo -t:25min timer start"
puts "USAGE pomo -i:3min timer start"
exit
end
end
if $0 == __FILE__
check_usage
case ARGV[0]
when "-i"
timer = "3m"
when "-b"
timer = "5m"
when "-t"
timer = "25m"
else
timer = ARGV[0]
end
`utimer --countdown=#{timer} 1>&2 && pomo_alarm`
end
/bin/sh -c 'notify-send "time over";cvlc --play-and-exit /usr/share/sounds/LinuxMint/stereo/desktop-login.ogg >/dev/null 2>&1' &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment