My Lenovo P50 laptop used to suspend nicely when I closed the lid on Ubuntu 19.10. After the upgrade this doesn't work anymore. When I execute the command sudo systemctl suspend
then the laptop still goes into a very rapid full functional suspend. So something seems to go wrong somewhere in handling the lid close event from acpi.
I'm using gnome-tweak-tools and it has the toggle to suspend on lid close enabled as expected.
I also checked the configuration in /etc/systemd/logind.conf and it seems perfect:
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend
LidSwitchIgnoreInhibited=yes
I haven't found anything noticable in the /var/log/syslog.
The workaround I found is the following:
Create a file called /etc/acpi/events/laptop-lid-close
with the following content:
event=button/lid LID close
action=/etc/acpi/laptop-lid-close.sh
And create a file /etc/acpi/laptop-lid-close.sh
with the following content and gave it execute rights (chmod +x /etc/acpi/laptop-lid-close.sh
):
#!/bin/sh
systemctl suspend
Would be better if this workaround would not be necessary ofcourse
Acpi seems to fire off 'lid close' events as it should, otherwise the workaround would not work. Also the suspend itself must be working on my laptop as well for the same reason.
Any clues on how to learn why this doesn't work out of the box?