Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support arbitrary script execution during countdown #44
I would like the ability to play sounds at certain intervals during the countdown. Basically, I like the
I think the most flexible way to achieve this is to add a new argument to termdown that accepts the path to an executable script. During each iteration of the countdown loop, termdown can call this script and pass it
So executing termdown would look something like:
Which will have the effect of termdown doing its normal 60 second countdown, plus on each second executing:
If I wanted to reimplement the current
More realistically, I want a 10 minute timer that gives me a 60 second and 10 second audible warning that is more pleasant than espeak's voice. So my script would be:
It might be nice if termdown also informed the script if
Maybe it would be cleaner if termdown provided this information to the script as environment variables rather than as positional arguments? Such that termdown is executing:
This would also solve #42.
referenced this issue
Jun 4, 2019
Yup, that's pretty much how I imagined it!
I think the only advantage to using environment variables is that, in the future, more context (like the critical seconds, or the value of some new flag that termdown was called with) can be passed to existing external scripts without breaking them. If those scripts depend on positional arguments, and termdown later changes the number or position of arguments it passes, it could break things for users.