Closed kennethso168 closed 6 years ago
I have added this feature in e1877cfbe5d221a66e0649d7e923d36dff04db1c Could you try it?
Thanks. Currently a little bit busy so I'll try out at maybe this weekend
Tried and tested with the following script and it works as expected:
test_kargos_refresh.30m.sh
:
#!/bin/bash
echo "Refreshed at: $(date +%H:%M:%S:%N)"
echo "---"
echo 'Click | refresh=true bash='\''notify-send "Time is $(date +%H:%M:%S:%N)"; sleep 5'\'
Result: a notification appears (take note of the time), and the text on panel should refresh around 5 seconds later.
So this is fixed and I'll close the issue. Thanks a lot for your great work.
Btw, are you interested in implementing greater compatibility with the bitbar standard? (specifically, my biggest wish would be the templateImage=..
, since currently there is no way to show a custom image on the panel in kargos). If so I'll open more issues here.
Per bitbar API:
This make sense for some use cases like a Trello todo list. When a "done" submenu item is clicked, it runs a script that make an HTTP PUT request to move the item to a designated list for done items, then the whole widget refreshes to remove the done item.
However, I think such behaviour is currently not possible for kargos, either for the "IconifiableButton" (the button you get without onclick defined)
or for direct clicking of the item when. I have looked at the source code (sorry not familiar with qml), and it seems that the "IconifiableButton" does not honor any refresh attribute.onclick=bash
And for the case when onclick is defined, the widget is updated before running bashIt would be nice if you could implement such behaviour. Thanks a lot!
Edit: after testing it seems that refresh works when
onclick=bash
. Therefore this problem only applies to the "IconifiableButton".