pomodoro icon indicating copy to clipboard operation
pomodoro copied to clipboard

Background and closing

Open Jwink3101 opened this issue 9 years ago • 1 comments

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

Jwink3101 avatar Feb 23 '16 23:02 Jwink3101

Thanks, I was busy with my daily commitments to work on that, thanks for mentioning it. Will you be interested in making a pull request to the repository? so this feature will be added. Looking forward to it. :)

rukshn avatar Feb 25 '16 11:02 rukshn