On Ubuntu 19.10 the gsettings set org.gnome.settings-daemon.plugins.power lid-close-*
actions don't seem to work any more.
Keep on running on lid-close instead of suspend
Edit the file /etc/systemd/logind.conf
with sudo
and change the line
#HandleLidSwitch=.....
to
HandleLidSwitch=lock
And reboot your system.
The file /etc/systemd/logind.conf
controls how logind shall handle the system power and sleep keys and the lid switch to trigger actions such as system power-off or suspend. Can be one of
"ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", and "lock". for these settings:
HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=,
HandleLidSwitchExternalPower=, HandleLidSwitchDocked=
Reference: