I use your script to time some particular tasks, and I can get often interrupted…
Hence, I found it interesting to add a pause functionality to the timer. I bound it to click-left in polybar and bound only one new timer creation on click-right.
I implemented the command polybar-timer.sh pause. First time it's called, it stops the running timer by creating a paused file with the remaining seconds until expiry and removes the expiry file. When it's called again on a paused timer, it recreates the expiry file from the paused file. If there's no running timer, it exits with return code 1.
This functionality should not change anything to the prior behavior of the timer. I tried to make the minimum possible changes to already existing code and follow the spirit of the code already written. I'm obviously open to comments on my modifications and suggestions to improve them.
I just added a simple description to the documentation for the pause command.
I could add a configuration example for the pause functionality, but it would imply heavier modification to the documentation. Maybe for a next commit if you are interested.
I use your script to time some particular tasks, and I can get often interrupted… Hence, I found it interesting to add a pause functionality to the timer. I bound it to
click-left
in polybar and bound only one new timer creation onclick-right
.I implemented the command
polybar-timer.sh pause
. First time it's called, it stops the running timer by creating apaused
file with the remaining seconds until expiry and removes theexpiry
file. When it's called again on a paused timer, it recreates theexpiry
file from thepaused
file. If there's no running timer, it exits with return code 1. This functionality should not change anything to the prior behavior of the timer. I tried to make the minimum possible changes to already existing code and follow the spirit of the code already written. I'm obviously open to comments on my modifications and suggestions to improve them.I just added a simple description to the documentation for the
pause
command. I could add a configuration example for the pause functionality, but it would imply heavier modification to the documentation. Maybe for a next commit if you are interested.Cheers,