I don’t prefer my laptop to switch to suspend state when my laptop lid is closed. So I found an easy way to disable suspend when lid is close.

Here is how is it done:

  • Open Terminal
  • type in the command below (as root)
sudo gedit /etc/systemd/logind.conf
  • Now the logind.conf file will open in Gedit text editor
  • set the variable “HandleLidSwitch” to “ignore”, as in the example below:
[Login]
 #NAutoVTs=6
 #ReserveVT=6
 #KillUserProcesses=no
 #KillOnlyUsers=
 #KillExcludeUsers=root
 #Controllers=
 #ResetControllers=cpu
 #InhibitDelayMaxSec=5
 #HandlePowerKey=poweroff
 #HandleSuspendKey=suspend
 #HandleHibernateKey=hibernate
 HandleLidSwitch=ignore
 #PowerKeyIgnoreInhibited=no
 #SuspendKeyIgnoreInhibited=no
 #HibernateKeyIgnoreInhibited=no
 #LidSwitchIgnoreInhibited=yes
  • Now reboot

With this change, reboot your system and feel free to close your laptop lid that it will no longer go to sleep. Now you are done!

Enjoy!

Darryl Dias

I’m Darryl. I’m a 3D Generalist, Web Developer and Linux enthusiast. On RevRYL I share my insights, tips and tricks, tutorials, methods and best practices.

Leave a comment

Your email address will not be published. Required fields are marked *