xbar icon indicating copy to clipboard operation
xbar copied to clipboard

Waking up from sleep or "Refresh all" resets custom positions

Open ArloL opened this issue 3 years ago • 5 comments

Thanks for this wonderful tool :) Customizing the menu bar is a lot of fun!

I was noticing an issue where the position of the icons gets reset:

https://user-images.githubusercontent.com/195367/139425738-7fda40c6-7bf1-42ec-ada9-5249ec79174a.mov

Is this expected behavior? It also happens when I close / open the lid of the laptop.

I am using xbar 2.1.7-beta on macOS 11.6.1

Let me know if I can give you more details.

Thanks!

I am only running this script:

#!/bin/sh
if pgrep "VBoxHeadless" > /dev/null; then
    echo ◼︎
elif pgrep "mutagen" > /dev/null; then
    echo ◼︎
elif pgrep -f "react-scripts" > /dev/null; then
    echo ◼︎
else
    echo ◻
fi

ArloL avatar Oct 29 '21 11:10 ArloL

I'm seeing the same behaviour, would love to see it fixed

taras-mukin avatar Jan 01 '22 12:01 taras-mukin

This is a Wails question, @leaanthony is there an event or something that occurs when people move the items in the menu bar. When xbar refreshes, it should reuse the old menus (it may be creating new ones).

matryer avatar Jan 04 '22 11:01 matryer

Just thinking that it will create the menu in the order that they are given. If they are stored in a map the order might be different?

leaanthony avatar Jan 04 '22 11:01 leaanthony

So I've paid a bit more attention to the behaviour and it seems like xbar just freezes completely sometimes, and probably if after that lid is closed positions get reset, or something like that. By "freezes" I mean items stop updating on their own, default menu on click still shows up, but "refresh" and "refresh all" options also do nothing. This is also not just script not working -- if this happens xbar shows previous output in gray text, which is not the case here. Complete quit and restart helps, and if done manually positions do restore to where they need to be.

taras-mukin avatar Jan 06 '22 22:01 taras-mukin

I'm also seeing this (macOS 13.1, xbar 2.1.7-beta via Homebrew, M1 MacBook Air) and it was driving me a bit crazy until I hit on the right search terms to find this issue. I have a single script running in xbar (a VPN monitor) and a Refresh All or the machine sitting idle long enough with the screen locked (not sleeping) causes the menu bar item to reset to the far left. Interestingly a reboot does not (it keeps its position from before the reboot)!

timkite avatar Dec 22 '22 23:12 timkite