You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Option to skip launch at login when no external displays are connected #1880
Is your feature request related to a problem? Please describe
MonitorControl currently launches at login unconditionally when "Start at login" is enabled. For users who only use the app with external displays (e.g., MacBook users who work mostly on the go), this means the app runs even when it's not needed, consuming resources and showing a menu bar icon that has no function without external monitors.
Describe the solution you'd like
Add conditional logic so that when the app launches at login, it checks whether external displays are connected. If no external displays are detected, the app should terminate early before showing the menu bar icon or running the full configuration.
Proposed approach:
Modify MonitorControlHelper/main.swift to pass a flag (e.g., --launched-at-login) when launching the main app
In AppDelegate.applicationDidFinishLaunching, check for this flag and the absence of external displays before setMenu() and configure()
If both conditions are true, call NSApp.terminate(nil) and return early
Use CGDisplayIsBuiltin() to detect external displays (this API is already used throughout the codebase)
Timing consideration: Display enumeration may not be complete at login time. Two mitigation strategies:
Add a short delay (1-2 seconds) before checking
Better: register a one-shot CGDisplayRegisterReconfigurationCallback to re-check when a display is connected later
Describe alternatives you've considered
Conditional launch at login registration: Not feasible with SMLoginItemSetEnabled — it's a boolean registration with launchd that has no conditional triggers.
Migrate to SMAppService (macOS 13+): While SMAppService offers more control, it still doesn't support conditional triggers based on display state. This would be a larger architectural change without solving the core problem.
User manually toggles "Start at login": Works but defeats the purpose of automation. Users with hybrid setups (sometimes external, sometimes not) would need to toggle the setting frequently.
Anything else?
Key files involved:
MonitorControlHelper/main.swift (lines 1-26) — helper that launches main app at login
This is a low-risk change that touches 2-3 files, uses existing infrastructure, and doesn't require architectural changes. I'd be happy to implement this if the maintainers think it's a good fit for the project.
Activity