This was working perfectly on 17.10 but after upgrading to 18.04 yesterday, when the lid is closed the screen turns off but doesn't suspend properly.
I travel around a lot and immediately noticed the heat (and battery draining) when taking it out of the travel case.
I've tried uncommenting these lines in /etc/systemd/logind.conf
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
and restarted but didn't make any difference.
Best Answer
I think I managed to figure out what was going on, thanks to these two sources: Dell XPS 13 (9370) ArchLinux Install notes and Arch Linux Forum.
For some reason, the laptop is not going in deep sleep anymore, but rather an
s2idle
mode which is merely a screen off type of suspend.Diagnosis of the issue
To confirm whether this is the case for your system, suspend the laptop using your favorite method (close the lid, hit
Fn
+End
, writepm-suspend
in a terminal if you havepm-utils
installed, or hit theWindows
key typesuspend
and hit theEnter
key).Wake up from suspend mode and type in a terminal:
sudo journalctl | grep "PM: suspend" | tail -2
. If the output isThen you are not entering deep sleep. You can also check
cat /sys/power/mem_sleep
which should returnwhich confirms that the default suspend mode is s2idle (since it is highlighted with brackets).
Temporary fix
To try a temporary fix, do
echo deep > /sys/power/mem_sleep
as a root user. Check that it was successful by looking at the output ofcat /sys/power/mem_sleep
which should bethen suspend the laptop and wake up again. If
sudo journalctl | grep "PM: suspend" | tail -2
returnsthen the issue should be fixed. You can put your computer to sleep for a couple of hours and check whether the battery drain improved.
Permanent fix
To make it permanent, you have to edit your bootloader cmdline. To do so, edit as root user the file /etc/default/grub, by running for example
sudo -H gedit /etc/default/grub
. Replace the linewith
and regenerate your grub configuration (run
sudo grub-mkconfig -o /boot/grub/grub.cfg
).