Skip to content

macOS: autostart as a login item so Settings shows the Weave icon - #2

Merged
bl0rb merged 1 commit into
mainfrom
claude/sweet-dirac-sqn926
Nov 3, 2026
Merged

bl0rb merged 1 commit into
mainfrom
claude/sweet-dirac-sqn926

Conversation

@bl0rb

@bl0rb bl0rb commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

System Settings → General → Login Items listed Weave with the generic "exec" icon. The cause is that tauri-plugin-autostart (MacosLauncher::LaunchAgent) writes a LaunchAgent pointing at the bare executable inside Weave.app.

  • New login item: src-tauri/src/login_item.rs registers Weave.app itself via SMAppService.mainApp (macOS 13+; the minimum here is 14). It should appear under "Open at Login" with the app icon.
  • Starting in the tray: a login item gets no --autostart argument. The launch Apple Event (kAEOpenApplication with keyAELaunchedAsLogInItem) now tells the app it started at login, so it stays quietly in the tray. The argument check stays as a fallback.
  • Migration: an existing LaunchAgent is removed once at startup and replaced by the login item.
  • Windows is unchanged.

Test plan

  • login_item.rs on its own: cargo clippy --target aarch64-apple-darwin against objc2 0.6.5, no warnings
  • Full build of the app: CI (no macOS SDK in the container)
  • On a Mac: turn autostart on; Settings shows the Weave icon; after logging in, Weave starts without a window
  • On a Mac with the old LaunchAgent: after the update the LaunchAgent is gone and the login item is active

Generated by Claude Code

The LaunchAgent of tauri-plugin-autostart points at the bare executable
inside Weave.app, so System Settings > Login Items listed it with the
generic 'exec' icon. SMAppService.mainApp registers the app bundle itself.
A login item gets no --autostart argument, so the launch Apple Event
(keyAELaunchedAsLogInItem) now decides whether to start quietly in the tray.
An existing LaunchAgent is migrated once on startup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W9t7Fewxv7bsWJPobVEtpS
@bl0rb
bl0rb merged commit 03a41e4 into main Nov 3, 2026
3 checks passed
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.

2 participants