Ask Your Question

how do I disable suspend when my laptop is plugged in and closed?

asked 2011-11-22 15:18:25 -0500

goozbach gravatar image

updated 2011-12-03 17:52:04 -0500

mether gravatar image

I want my laptop to only go into suspend mode when it's un-plugged, not when it is plugged in and the lid is closed. How can I disable that?

I'm using fedora 16

edit retag flag offensive close merge delete


It works this way out of the box in Fedora 19 (Dell Inspiron 17R)

alfC gravatar imagealfC ( 2013-07-10 20:11:17 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2011-12-05 15:26:28 -0500

ztank1013 gravatar image

updated 2011-12-05 15:48:56 -0500

Non command line approach:

Install dconf-editor

sudo yum install -y dconf-editor

then run dconf-editor program and browse to the power leaf :

org -> gnome -> settings-daemon -> plugins -> power

finally set the lid-close-ac-action field either to blank or nothing (but if you care about your planet choose blank, since it will probably save some power...)

Command line approach:

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


gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action nothing
edit flag offensive delete link more


the command line version should say lid-close-ac-action and not lid-close-battery-action to achieve the goal of the question.

alfC gravatar imagealfC ( 2013-01-20 05:44:38 -0500 )edit

This doesn't work in my Fedora 18. Any ideas? I tried both with dconf-editor and sudo dconf-editor.

alfC gravatar imagealfC ( 2013-03-23 13:35:58 -0500 )edit

worked like a charm on Fedora 17. Thanks!!

shadeslayer84 gravatar imageshadeslayer84 ( 2013-07-10 10:26:20 -0500 )edit

I have fedora 20 and LXDE desktop, no Gnome. This solution only messes up desktop. Removing dconf-editor solves what it caused. Further assist needed!

laamanni gravatar imagelaamanni ( 2014-03-25 14:09:22 -0500 )edit

For Gnome 3.X this did not work! Read my solution and vote up if it works for you!

X3MBoy gravatar imageX3MBoy ( 2014-05-20 12:43:43 -0500 )edit

answered 2013-03-27 00:27:17 -0500

updated 2017-03-20 11:10:21 -0500

Since fedora choose to use gnome 3.x, the dconf-editor doesn't work. This is because systemd override Gnome's ACPI Settings. A non-elegant solution is to edit /etc/systemd/logind.conf:

su -c 'vi /etc/systemd/logind.conf'

and set HandleLidSwitch to ignore:


and then restart systemd

su -c 'systemctl restart systemd-logind.service'

Hope that help


edit flag offensive delete link more


Spot on and easy. Thank you !

Sage gravatar imageSage ( 2013-07-03 19:23:46 -0500 )edit

This worked for me as well, while the other solutions didn't. Thank you!

liko gravatar imageliko ( 2014-02-05 19:48:40 -0500 )edit

I didn't have to edit anything, I found the line there by default (Fedora 20)

alfC gravatar imagealfC ( 2014-05-21 02:52:41 -0500 )edit

It's weird, the default file is set in 'suspend' and is commented.

X3MBoy gravatar imageX3MBoy ( 2014-05-22 00:13:55 -0500 )edit

What are the other possible options? ignore, lock, anything else? I'd like to turn the screen off, but still have the system run.

Ayos gravatar imageAyos ( 2014-11-10 19:36:43 -0500 )edit

answered 2011-11-22 15:52:56 -0500

SoumyaC gravatar image

Install gnome-tweak-tool

# su -
# yum install gnome-tweak-tool

After installation, open it and navigate to the left side Shell (entry). You will find on the right hand side options "Laptop lid close action on battery" "Laptop lid close action on AC".

Kindly select whatever you need to do when the Laptop Lid is closed and do a Alt+F2 "r" to reload gnome-shell or if required reboot to check its working for you or not.

edit flag offensive delete link more


Did the above help you to get your problem resolved ? If yes, can you mark the answer as favourite and help other users to get the correct solution.

SoumyaC gravatar imageSoumyaC ( 2011-12-02 13:08:16 -0500 )edit

Worked for me thanks

Mina Morcose Farage gravatar imageMina Morcose Farage ( 2016-04-29 04:53:30 -0500 )edit

This option is not availalbe in Fedora 27, I only see this unspecific option "Suspend when laptop lid is closed" [on/off]. Doesn't mention battery.

alfC gravatar imagealfC ( 2018-02-06 02:31:11 -0500 )edit

answered 2013-07-10 10:27:22 -0500

dconf-editor is very helpful for this kind of tweaking. Not just lid close, it provides a tons of other options. I'll suggest using dconf-editor.

edit flag offensive delete link more

Question Tools



Asked: 2011-11-22 15:18:25 -0500

Seen: 56,820 times

Last updated: Mar 20 '17