Ubuntu – Immediately lock screen when I close laptop lid under Gnome 3 (14.04)

14.04lock-screen

How can I configure my Ubuntu 14.04, logging in using Gnome 3, to lock the screen when I close my laptop lid?

All Settings ► Power only offers Do nothing or Suspend as options when I close the lid.

All Settings ► Brightness & Lock is configured with Lock ON, Lock screen after Screen turns off. It doesn't seem to work.

I've tried editing /etc/systemd/logind.conf to set HandleLidSwitch=lock and rebooting; nothing changed.

Best Answer

Easy way: after changing

HandleLidSwitch=lock

you have to restart the service

sudo systemctl restart systemd-logind
Related Question