0

After upgrading ubuntu 18.04 to 18.10 I noticed, that closing lid of laptop doesn't lock screen. And after opening it back it's enough to just use touchpad to unlock screen, no password is required.

This seams to be not acceptable by security reasons. The alternative I found is to change HandleLidSwitch in/etc/systemd/logind.conf to lock, but then it stop suspending, which seams to be not acceptable to, because of battery using.

Another solution found in archwiki, and is adding a systemd unit like

[Unit]
Description=User suspend actions
Requires=dbus.socket
Before=sleep.target

[Service]
User=pavel
Type=forking
Environment=DISPLAY=:0
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
ExecStartPre=
ExecStart=bash -c "env && /usr/bin/gnome-screensaver-command -l"
ExecStartPost=/bin/sleep 1

[Install]
WantedBy=sleep.target

This works most time, but sometimes silently fails with notification "lock was blocked by an application" after opening laptop, and

gnome-screensav[13495]: unable to send message: Timeout was reached
gnome-screensav[13495]: Did not receive a reply from the screensaver.

in log of systemd unit.

Any ideas on ways how to debug this? Or any much easier solutions I failed to found?

0

I too have this. I have suspend enabled on lid-close or hitting the power button. I find I have to hit Super-L twice to lock the screen. However, if I hit it just once prior to suspend then it resumes correctly (ie with the password screen).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.