In the past you could enable this behavior under lxde
with various combinations of xscreensaver-command -lock
and/or xss-lock
, but these options apparently no longer work under systemd
.
Assuming you are using lightdm
(which you should be on Ubuntu), you can use light-locker
to re-enable screenlocking on suspend/resume with xscreensaver
:
sudo apt-get install light-locker
then reboot.
Automatic locking on resume will be re-enabled, but you will have two different lock screens.
When waking up, the screen will be locked with the lightdm-greeter
screen.
When the xscreensaver
starts after a period of inactivity, you will still see the normal xscreensaver
unlock screen.