Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@berndbausch
Last active February 28, 2018 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berndbausch/32409ea0821b72e5558bc3f193fa82b5 to your computer and use it in GitHub Desktop.
Save berndbausch/32409ea0821b72e5558bc3f193fa82b5 to your computer and use it in GitHub Desktop.
Prevent Fedora laptop from suspending when closing its lid

How to close the laptop lid in Fedora 23 without suspending the PC

Since I often use my laptop as a desktop PC, I don't want it to suspend itself when I close the lid.

Gnome has the Tweak Tool, a GUI tool to change a number of settings. You can use it to ignore a closing lid, but this setting doesn't seem to be persistent. When I restart the laptop, closing the lid suspends it again.

It turns out that systemd manages this particular detail. It can be configured in /etc/systemd/logind.conf:

$ sudo vi /etc/systemd/logind.conf
HandleLidSwitch=ignore
$ sudo systemctl restart systemd-logind

It does what it claims to do: Closing the lid has no effect.

The setting is case-sensitive; a value of Ignore is not recognized:

$ sudo journalctl -u systemd-logind
G
systemd-logind[4372]: [/etc/systemd/logind.conf:24] Failed to parse handle action setting, ignoring: Ignore
...
systemd-logind[4372]: Lid closed.
systemd-logind[4372]: Suspending...
systemd-logind[4372]: Lid opened.

Reference: https://ask.fedoraproject.org/en/question/27808/preventing-lid-close-suspension/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment