How can I use a floating toolbar with a dynamic button icon image

Is it possible to have a dynamic button image on a floating toolbar button that automatically updates?
In my case, the button's file image content is periodically updated by another application throughout the day (In my case the image is actually a site "Up/Down" status badge. I would like to show in my floating toolbar).

If this is possible, how can I automatically refresh the floating toolbar button image on a timed interval, without closing and reopening the toolbar?

Related links:

Should be possible by making the icon change based on a variable, and having a script that changes the variable. You could use Task Scheduler or something similar to trigger the script periodically (running it via dopusrt.exe).

After the script changes the variable, it should call Command.UpdateToggle() to request a toolbar refresh.

If you use Task Scheduler (or something else outside of Opus), you might want to make it only run the script/command if Opus is running, to avoid launching Opus every time the timer fires if you wanted to have it shut down sometimes. Switch dark/light modes at certain times - #2 by Leo shows one way to handle that.

1 Like