I’m using GNOME 50 on Fedora 44. Whenever I close the laptop lid without an external monitor attached, the laptop suspends as expected. However, if an external monitor is attached, the laptop doesn’t suspend, and the external monitor remains active. Even though I understand this can be useful in some scenarios, that’s not my case, I would like the system to suspend regardless of having an external monitor attached.
I tried configuring systemd-login with
[Login]
# disables "clamshell mode" (keeping the display alive when the lid is closed)
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend
LidSwitchIgnoreInhibited=yes
But it didn’t have any effect. Gemini is suggesting I configure a udev rule to trigger when the lid state changes, but I would expect GNOME would allow me to handle this in a more direct way.
Is there any hidden property I can use to achieve the intended behavior?
The reason your logind.conf changes don’t take effect is that GNOME installs a systemd inhibitor for suspend so it could have its own policy. There used to be a setting for enabling suspend on lid close when an external monitor is connected, either in gnome-tweaks, or in gnome-control-center, but I couldn’t find it in GNOME 50 after a brief search.
In dconf it was /org/gnome/settings-daemon/plugins/power/lid-close-suspend-with-external-monitor (a boolean, defaulting to false), and I still see it. I cannot say whether it is still used. The description in the schema at least doesn’t say that it’s deprecated or obsolete.
dconf-editor and dconf dumpare different. Essentially, dconf dump shows only those settings that you (or some program on your machine) has changed from the default value. dconf-editor (as well as gsettings) also show their default values loaded from gsettings schema files.