Skip to content

feat(login): open at login as a login item instead of a launch agent - #56

Merged
rbstp merged 2 commits into
masterfrom
feat/login-item
Oct 16, 2026
Merged

rbstp merged 2 commits into
masterfrom
feat/login-item

Conversation

@rbstp

@rbstp rbstp commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Heed has run as a launch agent that the cask wrote and bootstrapped after install. Homebrew 7 ends that: Ruby postflight blocks fail brew style, and postflight_steps run in a sandbox that launchd refuses to bootstrap from (rbstp/homebrew-tap#2). It blocks SMAppService, LaunchServices and tccutil too, so there is no install-time way left to start Heed.

Heed now does what other menu bar utilities do. On its first launch it registers itself with SMAppService.mainApp, once, so switching it off in System Settings sticks, and a new Open at Login item in the menu turns it on and off. Without launchd behind it, Quit just quits, so QuitPlan and its tests are gone. Since nothing redirects stderr any more, Heed points it at ~/Library/Logs/heed.log itself whenever it isn't a terminal, which keeps Open Log, make logs and the cask's zap working.

make install boots out and removes the old agent before opening the new build, so a source install doesn't come back as two copies at the next login. make restart quits and reopens instead of using kickstart, and install-agent and agent.plist.in are gone. The cask side lives in rbstp/homebrew-tap#4, which has to merge first: the old cask's postflight reads agent.plist.in, which this release no longer ships.

Tested: swift test (286 tests), make check-package, and the real LoginItem and Log code compiled into a throwaway Developer ID–signed app with its own bundle ID, opened through LaunchServices. That covered first-launch registration, Open at Login off and on, a relaunch after switching off (it stays off), and the stderr redirect.

The cask used to write a launch agent and bootstrap it after install.
Homebrew 7 runs install steps in a sandbox that launchd refuses to bootstrap
from, and that also blocks ServiceManagement, LaunchServices and tccutil, so
no cask can start Heed any more. Heed now does what other menu bar utilities
do: on its first launch it adds itself to the login items with SMAppService,
and Open at Login in its menu turns that off again.

Without launchd behind it, quitting just quits, so the bootout plan and its
tests go. stderr is pointed at ~/Library/Logs/heed.log whenever it is not a
terminal, which keeps the log where the menu, make logs and the cask's zap
expect it. make install now removes the old agent, so a source install does
not end up with two copies at the next login, and then opens the app.
@rbstp
rbstp enabled auto-merge (squash) October 16, 2026 23:11
@rbstp
rbstp merged commit 506f1f8 into master Oct 16, 2026
3 checks passed
@rbstp
rbstp deleted the feat/login-item branch October 16, 2026 23:23
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.

1 participant