Skip to content

Add launch-at-login support #17

Description

@martinbha

Goal

Let users configure panes to start automatically at login on macOS and Windows.

Context

A tray-resident window manager is only useful if it is running; every comparable tool (including Rectangle via LaunchOnLogin.swift and its RectangleLauncher helper) offers launch-at-login. panes currently has no way to persist across reboots.

Scope

  • macOS: register as a login item. Prefer the modern SMAppService API (macOS 13+); decide the fallback story given the current unbundled dev binary. This likely depends on the app-bundle work in Add packaging and CI #9.
  • Windows: add/remove a HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run value or a Startup-folder shortcut.
  • Add a "Launch at login" toggle to the tray menu reflecting current registration state.
  • Persist the preference through the config system from Add persistent configuration loading #5 and reconcile with actual OS registration on startup.
  • Handle the moved/renamed binary case gracefully (stale registration should not error the app).

Implementation Notes

  • SMAppService.mainApp requires a proper bundle identifier and signed bundle to behave predictably; sequence this after Add packaging and CI #9 produces a real .app bundle.
  • Rectangle needed a separate launcher helper only for pre-13 macOS; panes can require macOS 13+ and skip the helper entirely.
  • Keep the registration APIs behind panes-platform traits so the tray toggle code stays shared.

Acceptance Criteria

  • Toggling "Launch at login" on and rebooting (or re-logging-in) starts panes on both platforms.
  • Toggling it off deregisters cleanly.
  • The tray checkbox reflects the real OS registration state, not just the stored preference.
  • A deleted or moved binary with a stale registration does not break startup.

Validation

  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • Manual login test on macOS and Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmacosmacOS platform adapter and integrationwindowsWindows platform adapter and integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions