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

Added ability to save a hs.menubar position between reloads #3195

Merged

Conversation

latenitefilms
Copy link
Contributor

- Added an optional `autosaveName` parameter to `hs.menubar.new()`, which allows you to set a unique identifier for the menubar, allowing it to save and restore it's menubar position across reloads.
- Added a method to get and set the `autosaveName` -`hs.menubar:autosaveName()`.
- Removed `hs.menubar.newWithPriority()` as it no longer works on macOS Catalina (and the minimum system requirements for Hammerspoon are now Catalina & above).
- Closes Hammerspoon#2878
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: pr-fix, pr-change, pr-feature, pr-maintenance

@github-actions
Copy link

github-actions bot commented Apr 22, 2022

View Test Results

    1 files      2 suites   11m 16s ⏱️
341 tests 289 ✔️ 50 💤 2

For more details on these failures, see this check.

Results for commit d00efa7.

♻️ This comment has been updated with latest results.

@latenitefilms
Copy link
Contributor Author

@cmsj & @asmagill - This should now be good to go unless you have any objections.

You can test by entering the following in the Console:

a = hs.menubar.new(true, "A"):setTitle("A")
b = hs.menubar.new(true, "B"):setTitle("B")
c = hs.menubar.new(true):autosaveName("C"):setTitle("C")
z = hs.menubar.new(true):setTitle("Z") -- this won't save position

...then change the menubar icon positions, restart/reload Hammerspon, run the code again, and the menubar items should be in the same position.

@cmsj cmsj merged commit 68a514e into Hammerspoon:master Apr 23, 2022
@cmsj cmsj added the pr-feature Pull Request implementing a feature label Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull Request implementing a feature
Projects
None yet
2 participants