In my brief testing, if you close the window, this will fail. You must first disown it and even then, you need to close with exit rather than ctrl+w (or q)
I do not know how it would work for such a big function, but you inspired me to write my own mac specific smaller version as follows:
timer() {
if [ -z "$1" ]; then echo "No set time. Setting for 25 minutes"; t=25; else echo "Timer set for $1 minutes";t=$1; fi
ttime=`bc <<< 60*$t`;
(nohup nice sleep $ttime && terminal-notifier -message 'Timer Finished: '$t' minutes' -title 'Timer' --subtitle 'Timers up!' && say -v bells "beep" &) > /dev/null 2>&1 ;
}
alias pom='timer'
The ( ) makes it launch a subprocess and nohup makes it in the background. Also nice is there but not really needed for a sleep command.
edit: Cleaned up the code I suggested
In my brief testing, if you close the window, this will fail. You must first disown it and even then, you need to close with
exitrather than ctrl+w (or q)I do not know how it would work for such a big function, but you inspired me to write my own mac specific smaller version as follows:
The
( )makes it launch a subprocess andnohupmakes it in the background. Alsoniceis there but not really needed for a sleep command.edit: Cleaned up the code I suggested