Tested on Fedora 43 with GNOME Shell 49.4. Two layers need to be configured: systemd-logind (the system) and GDM's gsd-power (the greeter), because GDM runs its own GNOME settings daemon that suspends independently.
sudo mkdir -p /etc/systemd/logind.conf.d
sudo tee /etc/systemd/logind.conf.d/lid.conf << 'EOF'
[Login]
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
EOFGDM's gsd-power will suspend the system when the greeter session goes idle — which happens immediately when the lid closes. This requires three files:
sudo mkdir -p /etc/dconf/db/gdm.d/locks
# Profile — tells GDM to read the system dconf database
sudo tee /etc/dconf/profile/gdm << 'EOF'
user-db:user
system-db:gdm
file-db:/usr/share/gdm/greeter-dconf-defaults
EOF
# Setting — disable idle suspend on AC and battery
sudo tee /etc/dconf/db/gdm.d/00-power.conf << 'EOF'
[org/gnome/settings-daemon/plugins/power]
sleep-inactive-ac-type='nothing'
sleep-inactive-battery-type='nothing'
EOF
# Lock — prevent the user-db layer from overriding
sudo tee /etc/dconf/db/gdm.d/locks/power << 'EOF'
/org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type
/org/gnome/settings-daemon/plugins/power/sleep-inactive-battery-type
EOF
sudo dconf updatesudo reboot# logind should say "ignore"
busctl get-property org.freedesktop.login1 /org/freedesktop/login1 \
org.freedesktop.login1.Manager HandleLidSwitch
# GDM should say "nothing" — DCONF_PROFILE=gdm is required
sudo -u gdm DCONF_PROFILE=gdm dbus-run-session \
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 2>/dev/null| Layer | What it does | Without it |
|---|---|---|
| logind drop-in | Tells the system to ignore lid events | System suspends via systemd |
| GDM dconf override | Disables GDM greeter's idle suspend | GDM's gsd-power suspends when greeter goes idle after lid close |
/etc/systemd/logind.conf.d/lid.conf
/etc/dconf/profile/gdm
/etc/dconf/db/gdm.d/00-power.conf
/etc/dconf/db/gdm.d/locks/power
All under /etc/, all survive dnf upgrade.
sudo rm /etc/systemd/logind.conf.d/lid.conf
sudo rm /etc/dconf/profile/gdm
sudo rm /etc/dconf/db/gdm.d/00-power.conf
sudo rm /etc/dconf/db/gdm.d/locks/power
sudo rmdir /etc/dconf/db/gdm.d/locks /etc/dconf/db/gdm.d 2>/dev/null
sudo dconf update
sudo reboot