原文地址:https://jamielinux.com/articles/2013/01/disable-suspend-on-fedora-18/
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
How about changing the behavoir to poweroff when the lid is closed. My suspend don't work for now anyways.
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.Thank you for this; for some reason Gnome Tweak Tool no longer has this option, so I was looking for a fix. Thanks again.
Great! Thank you, resolved my problem under Fluxbox!
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
@Dave: Thanks. Article updated :)
Thanks ! instead of ignore I used "lock". So the system locks when lid closes.
@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!
@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.
Thanks. Every fedora upgrade after 14 is a new surprise. (not positive....)