Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background and closing #5

Open
Jwink3101 opened this issue Feb 23, 2016 · 1 comment
Open

Background and closing #5

Jwink3101 opened this issue Feb 23, 2016 · 1 comment

Comments

@Jwink3101
Copy link

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

@rukshn
Copy link
Owner

rukshn commented Feb 25, 2016

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants