Skip to content

Instantly share code, notes, and snippets.

@smac89
Last active July 28, 2023 02:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smac89/ce0fc97a02788478dd06cbe738f0fdae to your computer and use it in GitHub Desktop.
Save smac89/ce0fc97a02788478dd06cbe738f0fdae to your computer and use it in GitHub Desktop.
Xfce Lockscreen with xsecurelock and xscreensaver #linux #xfce
  • Install both xscreensaver and xsecurelock using your package manager

  • Make sure xscreensaver is not set to lock the screen or to manage the display. Xfce aleady does all those, so there is no need to enable it again.

  • Also make sure that the xscreensaver daemon is not autostarted. Not doing this may result in the screen not being locked.

  • Set the following environmental variables (in ~/.xprofile or ~/.xsession) for xsecurelock:

    # xsecurelock options
    export XSECURELOCK_SAVER=saver_xscreensaver
    export XSECURELOCK_PASSWORD_PROMPT=disco XSECURELOCK_FONT='Noto Serif CJK JP'
    export XSECURELOCK_SHOW_DATETIME=1
    export XSECURELOCK_SINGLE_AUTH_WINDOW=1
    export XSECURELOCK_AUTH_TIMEOUT=30
    

    You can find more options here.

  • Finally, we need to tell xfce to use xsecurelock. Do that with this command:

xfconf-query --channel xfce4-session --property /general/LockCommand --set "xsecurelock"

Restart the current session or reboot. Profit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment