Home » OS » Linux » HOWTO: Stop Xubuntu and other Ubuntu based Linux from sleeping when closing the laptop lid

HOWTO: Stop Xubuntu and other Ubuntu based Linux from sleeping when closing the laptop lid

If you’re like me, 622px-Xubuntu_Logo.svg I hate having a laptop go into sleep or hibernate mode unless I tell it to. Here is an easy way to disable sleep and hibernate when you close the lid of your laptop:

sudo vi /etc/systemd/logind.conf

Uncomment “HandleLidSwitch” and set it to “ignore”:

[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

All we need to do is restart systemd-logind daemon:

sudo restart systemd-logind
Share Button

Comments

  1. Kasun says:

    Thanks. Worked perfectly on my laptop running xubuntu.

Leave a Reply

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

*
*

Facebook login by WP-FB-AutoConnect