Repository navigation
feat: uninstall StableBar and turn off the menu bar auto-hide it turned on - #339
Merged
Merged
Conversation
…ed on Setup turns on the macOS menu bar's auto-hide for the top edge, and nothing undid it once StableBar was gone. StableBar now remembers when it turned auto-hide on. Settings, General, Uninstall StableBar, or `StableBar --uninstall`, turns it off again, turns off Open at login, removes the stablebar command and Keychain tokens, resets permissions, deletes caches and preferences and moves the app to the Trash. ~/.config/stablebar goes only when asked, and a Homebrew install leaves the app to brew. Fixes #332
Only setup could change the menu bar's auto-hide, so after choosing the top edge the menu bar stayed hidden unless setup ran again or the setting was found in System Settings. Settings, General, Native menu bar now has Automatically hide the menu bar, which changes the macOS setting through System Events and keeps StableBar's record, so Uninstall still knows to turn off the auto-hide StableBar turned on. Fixes #210
feat: turn the macOS menu bar's auto-hide on or off from Settings
# Conflicts: # Sources/StableBar/LaunchCommand.swift # Sources/StableBar/StableBarApp.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Setup turns on the macOS menu bar's auto-hide for Top edge, Replace the menu bar and the Notch preset, and nothing turns it off once StableBar is gone. Dragging the app to the Trash, or
brew uninstall --zap --cask stablebar, also leaves the login item, thestablebarcommand, Keychain tokens and permissions behind. Fixes #332 and, through #340's commit, fixes #210.Changes
Remembering the menu bar (
MenuBarAutoHide.swift,SetupWindow.swift). Setup savesturnedOnMenuBarAutoHidein StableBar's preferences when it turns auto-hide on from a visible menu bar, and clears it when it turns auto-hide off. Auto-hide the user had before setup stays theirs, even when setup shows and hides the menu bar again. Skipping setup restores the setting and the record. At launch the record is dropped when auto-hide is off, so auto-hide turned on later in System Settings stays the user's. Only the turn-on is recorded, so Uninstall never hides a menu bar: auto-hide that setup turned off (Below menu bar) stays off.Uninstall (
Uninstall.swift). A snapshot of the Mac becomes these steps, in order:stablebarscripts StableBar wrote, found by their marker line (symlinks and other commands stay), with an administrator prompt when the folder isn't writable;StableBarservice;~/.config/stablebarto the Trash, only when asked;tccutil reset All org.stablebar.app, before the app moves, becausetccutilneeds the bundle registered;.appto the Trash, unless Homebrew's Caskroom hasstablebar.A failed step doesn't stop the others; each one comes with what to do by hand.
Settings → General → Uninstall (
UninstallView.swift,GeneralSettingsView.swift,SettingsSearch.swift). Uninstall… opens a sheet that lists the steps.brew uninstall --cask stablebar.StableBar --uninstall [--remove-config] [--show-menu-bar] [--yes](LaunchCommand.swift,StableBarApp.swift).--yes.--config(uninstalling is machine-wide),sudo, and a binary outside the app bundle, whose preferences domain differs.Removing the command (
CommandLineTool.swift).installedScriptsandremovesit next to install, and install and remove share the privilegedosascriptcall.Docs.
docs/getting-started.mdhas a new Uninstall section with the manual steps. Its line saying StableBar doesn't change macOS menu-bar settings is fixed.docs/settings.md,docs/command-line.mdanddocs/README.mdare updated, and the README's Install section gets one line.Homebrew. Run StableBar's uninstall when zapping homebrew-tap#1 adds a
zapscript that runsStableBar --uninstall --yes. Homebrew runszapdirectives before it removes the app, and the script falls back to the essentials when the app is gone or older. The guide's sentence about--zapassumes that PR is merged.There's no new configuration property, so decoding, the schema, layers, profiles and configuration edits don't apply. This branch also contains #340 (fixes #210), merged into it: Settings → General → Native menu bar → Automatically hide the menu bar, which turns auto-hide on or off outside setup and keeps the same record. #340 describes it.
Testing
swift test --filter 'UninstallTests|CommandLineToolTests': 45 tests, 31 of them new.--config; Settings search.PATH, one listing through a linked folder, a script that's already gone, keeping another command, and the privilegedrm.swift teston the rebased branch: 294 XCTest and 503 Swift Testing tests pass.Read-only checks of the real command line:
dist/StableBar.appand ran--uninstallwith stdin from/dev/null. It printed the plan for this Mac and stopped at "Add --yes", changing nothing.SMAppServicesees the login item from a process started in Terminal.--config … --uninstalland the bare debug binary refuse.tccutil reset All <id>works without root for a registered bundle (tried oncom.apple.Chess) and fails with -10814 for an unknown one; that's why permissions come before the app moves.An independent review pass found no blocking bug. Its findings are fixed in this commit:
--configisolation, stopping on a copy that won't quit, a stale record, a duplicate through a linkedPATHfolder,sudo, naming the copy that's trashed, and stopping widgets first.Not checked live. Dev builds share the bundle ID
org.stablebar.appwith the installed bar, so a real run would turn off its login item, delete its preferences and tokens, reset its permissions, remove/usr/local/bin/stablebarand change the menu bar. Also unverified:autohide menu barflips only_HIHideMenuBarand leavesAppleMenuBarVisibleInFullscreen, so the macOS 26 choice comes back as it was ("In Full Screen Only" or "Never");SMAppService.unregister()from Terminal;It's worth one run on a spare user account before release.
The screenshots are drawn offscreen from a scratch configuration, so the Configuration file path is a temporary one.
The sheet: StableBar turned auto-hide on (light, dark), auto-hide it didn't record, and a Homebrew install after a cancelled password prompt.
Merging
Two
featcommits, for #332 and #210, plus #340's merge commit. Use a merge commit or a rebase merge so both reach the changelog; a squash would keep only this title.Claude Opus 5.5 via Claude Code