How do I setup a keyboard shortcut to run xscreensaver-command -lock when I press ctrl+alt+l? I've had a look at Raspbian keyboard shortcuts, but that talks about finding the keyboard shortcuts, not setting them.

1 Answer 1


I just figured out how to do this. After having a look at ~/.config/openbox/lxde-pi-rc.xml. I just duplicated one of the <keybind> tags and edited the contents of the tag.

Heres my keybind:

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

You can find instructions to setup keybinds here

  • 1
    For those having a newer Raspian version: The path has changed to /etc/xdg/openbox/lxde-pi-rc.xml.
    – DonkeyKong
    Sep 6, 2020 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.