Created
October 8, 2013 10:56
-
-
Save andreineculau/6882969 to your computer and use it in GitHub Desktop.
bash timer
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
# After seeing that Mac AppStore has all these timers (both dumb and "smart") that each cost 3 USD (for what?!), | |
# I think this will do for 0 USD and 5 minutes. | |
# Works wonders as `timer 5 fuck off` :) | |
[[ "`uname`" == 'Linux' ]] && alias say="espeak" | |
function timer() { | |
minutes=${1:-1} | |
steep=$(($minutes*60)) | |
wakeup=${@:2} | |
wakeup=${wakeup:-"time's up"} | |
echo -e "Aye, aye!\nWaiting for $minutes minutes before $wakeup" | |
sleep $steep && say "$minutes minutes have passed, so $wakeup" & disown | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment