Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve items order in menu bar #2

Closed
2 tasks
melonamin opened this issue Nov 22, 2020 · 6 comments
Closed
2 tasks

Preserve items order in menu bar #2

melonamin opened this issue Nov 22, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@melonamin
Copy link
Contributor

  • Add persistence to items order in menu bar
  • Allow user to configure items order in Preferences
@melonamin melonamin added enhancement New feature or request good first issue labels Nov 22, 2020
@JayBrown
Copy link

JayBrown commented Nov 29, 2020

This might not be a viable solution for SwiftBar, but there was a workaround that one user found for BitBar. The order that scripts are loaded in BitBar is apparently based on their inode number, which you can see with e.g. stat -x foo. The workaround is then to put the actual regular files of the scripts somewhere else, and only create symbolic links to them in the SwiftBar plugins folder, and create those symlinks in the order you want your plugins to be. Therefore the plugin behind the symlink with the lowest inode will be on the far right, and the plugin behind the symlink with the highest inode will be on the far left.

But I assume that it's possible to create a better solution eventually, because this is just a workaround.

(On the other hand, SwiftBar could just create a "secret real plugins folder" somewhere in ~/Library, where it creates the symlinks to the plugins in the user-facing "fake plugins folder" in the right inode order, based on the order applied by the user in the GUI preferences.)

Another thing is to make a plugin preserve the actual place in the menu bar. With BitBar, even when using tools like Bartender, plugins tend to lose the place you assigned them with CMD-click&drag. (But that's an issue for another time, I assume… and another topic… but it might be related.)

@edjusted
Copy link

I use Bartender to rearrange and remember my menu bar items, and Bartender also can't seem to save Swiftbar menu item positions.

According to the Bartender developer, he's thinking that Swiftbar items don't get loaded in the same order and/or don't have the same ID every time they load, so nothing can keep track of where they should go.

@melonamin
Copy link
Contributor Author

items don't get loaded in the same order

This is what I'd like to address in this issue

don't have the same ID

I don't know enough about it and not sure what ID they're referring to, I need to research

@xilopaint
Copy link
Contributor

Will this feature be included when the preferences redesign is done? This is a relevant issue for streaming plugins.

@zkarj735
Copy link

zkarj735 commented Feb 1, 2021

I was researching this exact problem hence found this issue. After some testing I can declare that the order is not based on anything fixed in the filesystem or anywhere else. I quit and restart SwiftBar four times and got four different orders of my four plugins!

The one behaviour I can repeat is to rename a script and it will move to the far left. Until you quit and restart at least.

@minamotorin
Copy link

On BitBar, I preserve items order with defaults command: % defaults write com.matryer.BitBar "NSStatusItem Preferred Position Item-something" 13. But it (% defaults write com.ameba.SwiftBar "NSStatusItem Preferred Position Item-something" 13) doesn't work good with SwiftBar because item-something will change every loadings. I think this has something to do with “items don't get loaded in the same order” and “don't have the same ID”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants