Allow suspend with external monitor connected
When an external monitor is connected, gnome-settings-daemon
adds a systemd inhibitor to block handle-lid-switch
events:
$ systemd-inhibit --list --mode=block
Who: toupeira (UID 1000/toupeira, PID 2021/gsd-power)
What: handle-lid-switch
Why: Multiple displays attached
Mode: block
I currently don't have an external keyboard for my laptop, so this behaviour is really unexpected and not usable. It would be great to make this configurable, or maybe smarter to check for external inputs as well.
Some findings:
- Ubuntu patches in a setting for this called
lid-close-suspend-with-external-monitor
(link to the actual patch is dead) - gnome-tweaks confusingly has a setting called "Suspend when laptop lid is closed", but even when enabled this doesn't override the
gsd-power
inhibitor - logind has a setting
LidSwitchIgnoreInhibited
, but this doesn't apply to low-level locks such ashandle-lid-switch