Ubuntu: Fix screensaver not locking the screen

Updated . Posted . Visible to the public. Deprecated.

We don't think this is a problem any more.

If the default lock function of your desktop environment isn't working you can try this workaround with xautolock.

sudo apt-get install xautolock

Autolock runs a command after a given duration of inactivity. Your screensaver or "locker" usually has a programmatic way to lock the screen. How that command looks like depends on which environment you're using.

MATE

  • Go to Control Center and "Startup Applications".
  • Add a new application with the command xautolock -time 10 -locker "mate-screensaver-command -l"

The time is given in minutes.

light-dm

  • add the following command to the autostart of your desktop environment: xautolock -time 10 -locker "dm-tool lock"

The time is given in minutes.

gdm

  • install gnome-screensaver: sudo apt-get install gnome-screensaver
  • add the following command to the autostart of your desktop environment (gnome-session-properties): xautolock -time 10 -locker "gnome-screensaver-command -l"

The time is given in minutes.

Claus-Theodor Riegg
Last edit
Henning Koch
Keywords
screensaver, display, lock, linux
License
Source code in this card is licensed under the MIT License.
Posted by Claus-Theodor Riegg to makandra orga (2015-04-15 11:37)