How to disable suspend on Fedora 18

In Fedora 18, the default behaviour on laptops is to suspend when closing the lid.

To disable this behaviour, add the following line to /etc/systemd/logind.conf and reboot your system:

HandleLidSwitch=lock

The screen will lock after a delay, which is 10 minutes by default. You can lock your screen manually by pressing Ctrl-Alt-L.

Update #1: See man logind.conf for more options, such as triggering a shutdown when closing the lid.

Update #2: Instead of rebooting, you can just run systemctl restart systemd-logind.service as root user.

Update #3: A new option has been added to logind.conf that allows you to set lock instead of ignore.

Comments

Daniel Cabral | Jan 16, 2013

How about changing the behavoir to poweroff when the lid is closed. My suspend don't work for now anyways.

Jamie Nguyen | Jan 16, 2013

You can put HandleLidSwitch=poweroff in logind.conf to make your laptop shutdown when you close the lid. I've updated the article to mention the manual page which describes the various different options.

Bryce Hardy | Jan 22, 2013

Thank you for this; for some reason Gnome Tweak Tool no longer has this option, so I was looking for a fix. Thanks again.

Hermogene | Jan 23, 2013

Great! Thank you, resolved my problem under Fluxbox!

Dave | Jan 30, 2013

Thanks. btw there is no need to reboot after the edit of /etc/systemd/logind.conf just restart systemd-logind with
sudo systemctl restart systemd-logind.service

Jamie Nguyen | Jan 30, 2013

@Dave: Thanks. Article updated :)

Akash Kumar Sharma | Feb 12, 2013

Thanks ! instead of ignore I used "lock". So the system locks when lid closes.

Jamie Nguyen | Jan 30, 2013

@Akash: Oh cool! I'm pretty sure I didn't see that option in the man page when I wrote this article so it must be a recent addition to the Fedora package. Article updated. Thanks!

Samuel Sieb | Feb 15, 2013

@Bryce: The reason it's not in the Tweak Tool any more is because Gnome doesn't handle the lid switch any more.  That's why you have to modify the systemd config file.

Nikos Feidopiastis | Mar 07, 2013

Thanks. Every fedora upgrade after 14 is a new surprise. (not positive....)

Todd vandenbroecke | May 16, 2013

OMG THANK YOU SO MUCH, I've been working on this issue for a long time now and NON of the other methods work, gnome-tweak-tool doesnt have the option, the dconf-editor has the option but it gets ignored and every other suggestion has not worked.  AWESOMENESS DUDE, THANKS!

Comments are now closed.