Start on System Startup: show the real OS state, and use a login item on macOS
Facebook Messenger on your desktop, without the Facebook clutter
Brought to you by:
kristoffer-r
Originally created by: kristofferR
Start on System Startup only ever writes the setting. settings::sync_autostart calls enable() or disable() on tauri-plugin-autostart and never checks the result against the OS afterwards. Every platform lets the user turn startup off outside Chatpane, and Chatpane's setting then stays on while Chatpane doesn't start:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run value in place and record the disable under HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run, which Chatpane never reads.~/.config/autostart/*.desktop or set Hidden=true in it.MacosLauncher::LaunchAgent (lib.rs), a plist in ~/Library/LaunchAgents. On macOS 13+ it shows in System Settings → General → Login Items under "Allow in the Background", without being clearly tied to Chatpane, instead of as an "Open at Login" app, and can be switched off there.Chatpane's setting shows whether Chatpane will really start at login, on every platform. On macOS 13+, Chatpane is a normal "Open at Login" item.
StartupApproved\Run entry, if any, isn't marked disabled. If the user disabled it in Task Manager, turning it back on in Chatpane also clears that disable, or the setting says to use Task Manager. Decide which while implementing.Hidden=true, and launches this install.SMAppService.mainApp.status, including requiresApproval with a button that opens Login Items (SMAppService.openSystemSettingsLoginItems).SMAppService.mainApp (objc2 ServiceManagement). When switching, remove the old LaunchAgent plist so Chatpane doesn't launch twice. macOS 10.15 to 12 keeps the LaunchAgent.