1

Ever since I upgraded to 19.10, when I close the lid the laptop doesn't suspend anymore. It doesn't even lock the screen. It almost seems like the OS isn't picking up the close lid event. If I press the power button suspend works fine and resumes when I open the lid afterwards.

I have the 'suspend when lid is closed' option enabled in GNOME Tweaks.

Any idea on how to fix/debug this issue? I have a Dell XPS 15 9560.

pomsky
  • 68,507
  • Do you have GNOME Tweaks? If not, install it and see what options you get in the 'Power' section. – pomsky Jan 09 '20 at 10:30
  • I have it and have set the flag to suspend when lid is closed but it doesn't work. – Gonçalo Marrafa Jan 09 '20 at 14:35
  • Please try this and report back: https://askubuntu.com/questions/1196871/gnome-supend-on-laptop-lid-close-no-longer-works-since-19-10-upgrade – pomsky Jan 09 '20 at 14:37

2 Answers2

0

First, make sure that pm-utils is installed.
sudo apt install pm-utils.
Then,edit the logind.conf file. You should always back up a critical file before changing it.
sudo cp /etc/systemd/logind.conf /etc/systemd/logind.conf.back.
Now, edit the file.
sudo gedit /etc/systemd/logind.conf
You'll see some lines like this.

#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288

What you have to do is to remove the # from some of the lines and change it’s value to

HandleSuspendKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

Now, restart your system and see if your laptop goes into suspend.

0

With root priviledges, open /etc/systemd/logind.conf with a text editor:

sudo nano /etc/systemd/logind.conf 

Add this line to the file:

HandleLidSwitch=suspend

Save the changes and check if the desired behaviour is observed after reboot.

Quasímodo
  • 2,017