Using xscreensaver to lock the screen in Lubuntu

Recent versions of Lubuntu seem to have broken screen locking.

To get screen locking via xscreensaver do this:

# Install xscreensaver
sudo apt-get install xscreensaver

# Start xscreensaver when you log in
echo "xscreensaver -nosplash" >> ~/.config/lxsession/Lubuntu/autostart

# Edit the "screen lock" launcher
sudo leafpad /usr/share/applications/lubuntu-screenlock.desktop

Change lubuntu-screenlock.desktop to look like this:

[Desktop Entry]
Name=ScreenLock (xscreensaver)
Name[zh_TW]=鎖住螢幕
Comment=Lock your screen
Icon=system-lock-screen
Exec=xscreensaver-command -lock
NoDisplay=true

If you want a keyboard shortcut to lock the screen, add this entry (under another <keybind> tag) to ~/.config/openbox/lubuntu-rc.xml:

    <keybind key="C-A-l">
      <action name="Execute">
        <command>xscreensaver-command -lock</command>
      </action>
    </keybind>

2 thoughts on “Using xscreensaver to lock the screen in Lubuntu”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.