There are lots of confusing discussions out there related to these settings in logind.conf
HandleLidSwitch
HandleLidSwitchExternalPower
HandleLidSwitchDocked
LidSwitchIgnoreInhibited
Most people seem to want to keep their laptops running with the lid closed when connected to an external monitor and this is now the default behavior in Ubuntu 22.04
I want the opposite, and that now seems to be impossible.
The clearest explanation I have found of how its intended to work is from Poettering himself here
My situation in short:
HandleLidSwitch*=suspend
LidSwitchIgnoreInhibited=true
But gsd-power is blocking handle-lid-switch when a monitor is connected (shown by:systemd-inhibit --list --mode=block
), and LidSwitchIgnoreInhibited=true
has no effect since this is a "low level inhibitor".
Additionally IgnoreLid=true
in UPower.conf
does not stop gsd-power from taking the lock and this is now possibly "as designed"
I read a suggestion somewhere that dbus could possibly be used to block upower from taking this lock, but I can find no further details of how this could be done.
All in all I would have thought this would be a quite common and reasonable behavior to want from a laptop, but now I'm stuck sideways way down this rabbit hole and I could really use some help getting out!