How to set action when I close my laptop lid in Fedora?

In Earlier Fedora Versions, we can set actions using this command:-

Command line approach:

gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action blank

or

gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action nothing

But in current version it says there is no such key because This is all handled by systemd now in Fedora 18+.

As root, edit /etc/systemd/logind.conf. You’re looking for the definition for HandleLidSwitch, it may be commented out.

The default is: HandleLidSwitch=suspend

You can set it to ignore, poweroff, reboot, halt, suspend, hibernate, hybrid-sleep, lock or kexec. Since your laptop screen is broken, you just want to set it to ignore, so add this to /etc/systemd/logind.conf:

HandleLidSwitch=ignore

Then, run systemctl restart systemd-logind, or simply reboot for it to take effect.

Leave a comment