@DanThomas and @iNik had some suggestions that got me started in the right direction here:
I’ve been wanting to integrate Bitbar with KM to do a Countdown timer, but I’m not sure what the best way to pull this off is. I think this could be really useful to people who want to Timebox their tasks and automatically advance from one thing to another in specific increments.
I built a simple Timebox solution while I was on an animation project. It forced me to work fast and push through all the frames. Once I went through the rough pass, I went back and cleaned things up. The timer control made things infinitely more do-able to meet a short deadline.
However, I would like to have the time remaining countdown somewhere visible, like the menu-bar.
Thank you Peter! It's very helpful to see a better understanding of this method. I may hybridize a Custom HTML prompt into the solution I came to below so that I can get a little more sophisticated in how I manage my time blocks, so this example is very helpful.
If anyone's interested, and wants a timer on their top menubar I figured out you can use Bitbar like so:
Download Bitbar and countdown timer script for it.
Make sure the script is named 1s so that it will refresh every second.
Set the variable in KM
Launch countdown timer script with this shell script that passes the variable in:
ruby /bitbarLocation/countdown_timer.1s.rb "$KMVAR_bitbar__timeAmount"s
Any way to make the background turn a color when the time expires or even better, set the system volume to xx and make a sound?
Or even flash the menu bar until you address it?
If I add the statement window.close() anywhere in this script, it not only doesn’t work, it crashes the KM engine. If I create a new function that contains this command, same result.
Obviously I don’t know enough about Javascript to do this correctly, so any further help would be appreciated.
Hey Peter sorry to start this up again but did you build a next version of this? also wondered how you would get an alert dialog every 10 minutes of the countdown. So if the countdown was set for 30 minutes at 10 minute intervals an alert would pop up. Also is it possible using this to pause/continue the timer at all in that window?
I'm having trouble understanding what you are trying to do. I suggest you start a new topic, with a full articulation of what you are trying to do (including, if appropriate, a reference to this thread).
As far as “next version”, the crash reported about has long since been resolved.
First of thank you so much for this macro, I use it for my focus sessions (pomodoros) and it's working wonders for my productivity to have the html prompt always visible.
I wanted to ask, how could I add a cycles counter to it ? I would like to count how many pomodoros I did, and display them under the timer like "1 of 10" , and everytime the timer ends it increments this counter's value by one, then resets to 0 on the next day.
The goal is to count how many pomodoros I do in a day, every day.
I would be very grateful if someone could help with this