Skip to content

Background and closing #5

@Jwink3101

Description

@Jwink3101

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions