Toggle to keep the laptop running with the lid closed (KVM / clamshell) #8478
Ojisan1
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Omarchy already handles clamshell display well: lid-close disables the internal panel once an external monitor is active, and the monitor watcher recovers it. Lid-close power is a separate path, and that is the gap for KVM use.
The gap
systemd-logind still owns suspend on lid close (
HandleLidSwitch=suspend,HandleLidSwitchDocked=ignore). “Docked” means a docking station or more than one display connected. That works when the external display is already live before the lid closes.It fails for a typical KVM:
The coffee cup (
StayAwake/omarchy toggle idle) only skips idle screensaver and idle lock. It does not take ahandle-lid-switchinhibitor, so it does not keep the machine running across a lid close. That split is useful: at a KVM you often still want idle lock on the external screen.Suggested UX
A second bar indicator, independent of the coffee cup:
systemd-inhibit --what=handle-lid-switch --mode=block. Lid close does not suspend. Existing Hyprland lid binds still runomarchy-system-lid-close/omarchy-hyprland-monitor-clamshell, so the internal panel turns off once the external display is live. Idle lock/screensaver stay as they are.Click it before docking; click it off before packing the laptop. Persist the on state across reboot so a desk machine comes back already in dock mode.
Do not set
HandleLidSwitch=ignoreglobally. The session inhibitor is enough, needs no root, and drops when the toggle is off.Why not fold this into the coffee cup
Coffee cup = “don’t lock on idle.” Dock mode = “don’t sleep on lid close.” Mixing them means a docked KVM would not idle-lock unless you also turn stay-awake off (which would re-enable lid-suspend), and a closed lid in a bag would not sleep while the cup is on.
Prototype
I have this running as a user plugin on Omarchy 4.0.1 (Dell XPS 14, KVM + external display): a bar icon plus a systemd user unit that holds the
handle-lid-switchblock inhibitor. Happy to turn it into a first-party indicator next to StayAwake, withomarchy toggle …, if this UX is wanted.Happy to adjust the design (auto-on when an external display appears, different icon placement, etc.) if you would rather not add a second indicator.
All reactions