matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.49k stars 643 forks source link

refresh=true not working? #839

Open wujek-srujek opened 2 years ago

wujek-srujek commented 2 years ago

xbar 2.1.7-beta installed via homebew on a M1 Pro.

I have a plugin based on this one https://gist.github.com/dAnjou/10e51c7de9eb55bbb57b96795c468139 and I added refresh=true after the 'start' and 'stop' commands as described here: https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md?plain=1#L76 e.g. like this:

echo -n 'Start Colima | shell="colima" param1=start terminal=true refresh=true'

but it doesn't refresh. Same happens for other scripts.

adminy commented 1 year ago

same here. Its not re-executing the script every time you open the menu.

Current workaround is having to manually click refresh or refresh all in the xbar submenu.

BartmanEH commented 4 months ago

I have issues with refresh as well. First of all, try following the documentation here: https://github.com/matryer/xbar-plugins/blob/main/CONTRIBUTING.md which shows using pipe character between parameters so try this: echo -n 'Start Colima | refresh=true | terminal=true | shell="colima" param1=start I also found I need to put those parameters first before the shell parameter. Next I find that although the refresh is supposed to happen after the shell command completes (according to the documentation), I find the refresh occurs much sooner in the same way javascript runs asynchronously so I add xbar://app.xbarapp.com/refreshPlugin?path=<plugin filename> ...at the end of my menu-launched scripts and this does in fact cause the plugin to refresh (status updates properly in xbar menu text etc.) when I expect--at the end of script execution.