Skip to content

--enable-login-item registers and exits; install launches the app afterwards - #3

Open
njoubert wants to merge 2 commits into
mainfrom
enable-login-item-exits
Open

njoubert wants to merge 2 commits into
mainfrom
enable-login-item-exits

Conversation

@njoubert

Copy link
Copy Markdown
Owner

What changed

  • --enable-login-item registers the Login Item, sets loginItemRegistered, prints the state and exits, matching --disable-login-item.
  • build.sh install runs the installed binary with the flag synchronously (its output is the status line) and then opens the app. The sleep 1.5 and the separate --login-item-status call are gone.
  • First launch from /Applications still self-registers when the default is unset.
  • README's LoginItem.swift bullet describes the new sequence.

Also in this PR: the package did not build on Xcode 27

The first commit splits the --dump-chart fake-data expression into three typed lets. Xcode 27's Swift 6.4 compiler reports "unable to type-check this expression in reasonable time" on the one-liner, in both debug and release, on main as it stands. Same numbers, same chart.

Why

Running the installed copy with --enable-login-item while the app was already open started a second instance in the menu bar. Seen on 2026-09-14 in the sibling Leviton Bar while re-registering its Login Item after the macOS 27 upgrade dropped the record; Net Bar shares the code. Sibling PR: njoubert/nimbus-leviton-bar#2.

Verified

  • swift build and prek run --all-files pass on each commit.
  • .build/debug/NimbusNetBar --login-item-status still parses; --dump-chart still renders the 896x256 PNG.
  • Not run: build.sh install, which would quit the running copy. No per-tick code changed, so no load measurement.

🤖 Generated with Claude Code

njoubert and others added 2 commits September 15, 2026 13:51
…eck it

Xcode 27's compiler gives up on the one-line Rate(...) with its mixed integer
literals, Double conversions and ternary ("unable to type-check this expression
in reasonable time"), which broke every build of this package on that toolchain.
Three typed lets, same numbers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…erwards

The flag used to set a variable and let the app start, so a caller that only
wanted the registration (build.sh install, or a hand run while the app was
already open) got a second instance in the menu bar. It now registers, sets
loginItemRegistered, prints the state and exits, like --disable-login-item.
build.sh install runs it synchronously and then opens the app, so it no longer
needs the sleep or the separate --login-item-status call. README follows.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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