3

I'm running Fedora 15 Gnome on a laptop. I can't seem to find an option to toggle if the laptop goes to sleep when the lid closes. There are certain times where I want to put the laptop away or close it but still have it do some crunching on some long running task

Is there a place to toggle this option?

Wieland
  • 6,353
  • 3
  • 28
  • 31
TheLQ
  • 1,376
  • 4
  • 18
  • 34
  • 1
    Does this answer your question? [GNOME: disable sleep on lid close](https://unix.stackexchange.com/questions/307497/gnome-disable-sleep-on-lid-close) – rugk Mar 12 '21 at 22:46

2 Answers2

2

Gnome Tweak Tool allows you to change that.

TheLQ
  • 1,376
  • 4
  • 18
  • 34
Wieland
  • 6,353
  • 3
  • 28
  • 31
1

This worked for me, just run the command as superuser. For GNOME, this is now handled by systemd in Fedora 18+.

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

Modified Command : sudo gedit /etc/systemd/logind.conf You could also change dir to the folder be for running the code.

$ cd /etc/systemd
$ sudo gedit logind.conf 

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.
From : Preventing lid close suspension

Uncomment by deleting the # by the command. Then change suspend to ignore.

niiabe
  • 11
  • 1