exlab_wizard.tray.autostart#

Per-platform autostart registration. Backend Spec §4.3.2 + §15.7.

Registers ExLab-Wizard-Tray to launch at user login. Reversible from Settings -> Application (Frontend §7).

Per-platform mechanism:

  • macOSLaunchAgent plist at ~/Library/LaunchAgents/com.exlab-wizard.tray.plist with RunAtLoad: true.

  • WindowsHKCU\Software\Microsoft\Windows\CurrentVersion\Run registry entry. Per-user only (no HKLM writes).

  • Linux~/.config/systemd/user/exlab-wizard-tray.service plus the XDG ~/.config/autostart/exlab-wizard-tray.desktop fallback for non-systemd setups (§15.7.1).

Tests inject a filesystem_root (or set the EXLAB_AUTOSTART_ROOT env var) so the manager writes to tmp_path instead of a real per-user location. Real per-OS registration is left to the launcher in production.

Classes

AutostartManager(*[, executable_path, ...])

Per-platform autostart register / unregister / is_registered.

class exlab_wizard.tray.autostart.AutostartManager(*, executable_path=None, filesystem_root=None, platform=None)[source]#

Bases: object

Per-platform autostart register / unregister / is_registered.

Construction-time parameters:

  • executable_path – absolute path to ExLab-Wizard-Tray. The production launcher resolves sys.executable (PyInstaller bundles set sys.executable to the launcher binary).

  • filesystem_root – root directory for per-user files. Defaults to Path.home() in production; tests inject tmp_path. The env-var override EXLAB_AUTOSTART_ROOT wins over the constructor default.

  • platform – override the OS dispatch, used by tests to exercise every branch on a single host.

Parameters:
property executable_path: str#

Return the absolute path the autostart record points at.

is_registered()[source]#

Return True iff a per-platform autostart record exists.

Return type:

bool

property platform: Platform#

Return the platform dispatch this manager is configured for.

register()[source]#

Create the per-platform autostart record. Idempotent.

Return type:

None

unregister()[source]#

Remove the per-platform autostart record. Idempotent.

Return type:

None