I use Ubuntu 18.04. When I close my laptop, and open it again, I find all my previously opened programs are lost. My Power configurations has "Off" in the "Automatic Suspend". Also, in "When the Power Button is pressed" I have "Off". But closing the laptop is not pressing the power button.
The lid close action seems to already be set to "suspend":
$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
'suspend'
This is very annoying. I want to close my laptop (i.e., closed the screen. This is different from pressing the power button) and find all my previously opened programs.
Note: Suspend works on RAM, therefore you should have enough RAM to sustain all your open apps otherwise 'suspend' won't work properly. See the output of
free m
with all the apps usually open when you 'suspend'.Open terminal and run:
and
If that doesn't work:
sudo gedit /etc/systemd/logind.conf
and uncomment (remove "#") from the lines