-
-
Save tsu-nera/8748283 to your computer and use it in GitHub Desktop.
pomodor 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/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 |
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
/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