Skip to content

feat: uninstall StableBar and turn off the menu bar auto-hide it turned on - #339

Merged
M4n0x merged 4 commits into
mainfrom
feat/332-uninstall
Oct 26, 2026
Merged

M4n0x merged 4 commits into
mainfrom
feat/332-uninstall

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

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, the stablebar command, Keychain tokens and permissions behind. Fixes #332 and, through #340's commit, fixes #210.

Changes

  • Remembering the menu bar (MenuBarAutoHide.swift, SetupWindow.swift). Setup saves turnedOnMenuBarAutoHide in 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:

    • quit other running copies; if one won't quit, the run stops before anything changes;
    • turn off auto-hide;
    • turn off Open at login;
    • remove the stablebar scripts StableBar wrote, found by their marker line (symlinks and other commands stay), with an administrator prompt when the folder isn't writable;
    • delete Keychain items under the StableBar service;
    • move ~/.config/stablebar to the Trash, only when asked;
    • tccutil reset All org.stablebar.app, before the app moves, because tccutil needs the bundle registered;
    • delete caches, HTTP storage and the preferences domain;
    • move the .app to the Trash, unless Homebrew's Caskroom has stablebar.

    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.

    • Turn off the macOS menu bar's auto-hide is checked only when StableBar recorded turning it on. When nothing was recorded, which includes setups finished before this change, it's shown unchecked.
    • Also move ~/.config/stablebar to the Trash is off by default.
    • It stops the bar's widgets and update checks, runs the steps and quits. When a step fails, or Homebrew installed the app, it shows what's left before quitting, with a copyable brew uninstall --cask stablebar.
    • Settings search finds it.
  • StableBar --uninstall [--remove-config] [--show-menu-bar] [--yes] (LaunchCommand.swift, StableBarApp.swift).

    • It prints the same plan and asks y/N in a terminal; without one, it needs --yes.
    • It refuses --config (uninstalling is machine-wide), sudo, and a binary outside the app bundle, whose preferences domain differs.
    • It exits 1 when a step fails.
  • Removing the command (CommandLineTool.swift). installedScripts and remove sit next to install, and install and remove share the privileged osascript call.

  • Docs.

    • docs/getting-started.md has 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.md and docs/README.md are updated, and the README's Install section gets one line.
  • Homebrew. Run StableBar's uninstall when zapping homebrew-tap#1 adds a zap script that runs StableBar --uninstall --yes. Homebrew runs zap directives 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 --zap assumes 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.

    • Recording: which changes count as StableBar's, and dropping the record once the menu bar shows.
    • The step plan: order, a clean Mac, auto-hide known, unknown and visible, keeping the configuration, Homebrew.
    • Step titles and fixes; finding caches and a Caskroom.
    • Running: keeping going after a failure, a cancelled password prompt, stopping when a copy won't quit.
    • The command's plan text and option parsing, including refusing --config; Settings search.
    • Commands to remove: StableBar's scripts only, the install folder off PATH, one listing through a linked folder, a script that's already gone, keeping another command, and the privileged rm.
  • swift test on the rebased branch: 294 XCTest and 503 Swift Testing tests pass.

  • Read-only checks of the real command line:

    • Built dist/StableBar.app and ran --uninstall with stdin from /dev/null. It printed the plan for this Mac and stopped at "Add --yes", changing nothing.
    • The plan listed Turn off Open at login, so SMAppService sees the login item from a process started in Terminal.
    • --config … --uninstall and the bare debug binary refuse.
  • tccutil reset All <id> works without root for a registered bundle (tried on com.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: --config isolation, stopping on a copy that won't quit, a stale record, a duplicate through a linked PATH folder, sudo, naming the copy that's trashed, and stopping widgets first.

  • Not checked live. Dev builds share the bundle ID org.stablebar.app with 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/stablebar and change the menu bar. Also unverified:

    • that System Events' autohide menu bar flips only _HIHideMenuBar and leaves AppleMenuBarVisibleInFullscreen, so the macOS 26 choice comes back as it was ("In Full Screen Only" or "Never");
    • SMAppService.unregister() from Terminal;
    • the administrator prompt for removing the command.

    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.

Before After
Light
Dark

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 feat commits, 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

…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
M4n0x added 2 commits October 26, 2026 18:58
feat: turn the macOS menu bar's auto-hide on or off from Settings
# Conflicts:
#	Sources/StableBar/LaunchCommand.swift
#	Sources/StableBar/StableBarApp.swift
@M4n0x
M4n0x merged commit 6a1443b into main Oct 26, 2026
7 checks passed
@M4n0x
M4n0x deleted the feat/332-uninstall branch October 26, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uninstall StableBar and put back the macOS settings it changed Turn the macOS menu bar's auto-hide back off outside setup

1 participant