mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-10-23 08:07:35 -06:00
[GH-ISSUE #1880] Option to skip launch at login when no external displays are connected #1303
Labels
No labels
Status: Abandoned
arm64
beta
beta
bug
done
duplicate
enhancement
feedback needed from reporter
in progress
information
invalid
investigating
known Issue
monitor Issue
pull-request
translation
unable to reproduce
unreleased
x86
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/MonitorControl#1303
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @looreenz on GitHub (Jul 29, 2026).
Original GitHub issue: https://github.com/MonitorControl/MonitorControl/issues/1880
Before opening the issue, have you...?
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:
MonitorControlHelper/main.swiftto pass a flag (e.g.,--launched-at-login) when launching the main appAppDelegate.applicationDidFinishLaunching, check for this flag and the absence of external displays beforesetMenu()andconfigure()NSApp.terminate(nil)and return earlyCGDisplayIsBuiltin()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:
CGDisplayRegisterReconfigurationCallbackto re-check when a display is connected laterDescribe 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
SMAppServiceoffers 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 loginAppDelegate.swift(lines 53-69) —applicationDidFinishLaunchingstartup flowAppDelegate.swift(line 65) — existingCGDisplayRegisterReconfigurationCallbackusageDisplayManager.swift(lines 163-190, 290-292) — existing display enumeration andCGDisplayIsBuiltinusageThis 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.