No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Added PKGBUILD Feb 23, 2013
LICENSE Initial commit Feb 23, 2013
Makefile use custom PAM file (fixes #6) Mar 24, 2014 update sxlock.service in README Oct 8, 2017
sxlock.c expand usage section Jul 8, 2017
sxlock.pam use custom PAM file (fixes #6) Mar 24, 2014

sxlock - simple X screen locker

Simple screen locker utility for X, fork of sflock, which is based on slock. Main difference is that sxlock uses PAM authentication, so no suid is needed.


  • provides basic user feedback
  • uses PAM
  • sets DPMS timeout to 10 seconds, before exit restores original settings
  • basic RandR support (drawing centered on the primary output)


  • libX11 (Xlib headers)
  • libXext (X11 extensions library, for DPMS)
  • libXrandr (RandR support)
  • PAM


Arch Linux users can install this package from the AUR.

For manual installation just install dependencies, checkout and make:

git clone git://
cd ./sxlock

Hooking into systemd events

When using systemd, you can use the following service (create /etc/systemd/system/sxlock.service) to let the system lock your X session on hibernation or suspend:

Description=Lock X session using sxlock



However, this approach is useful only for single-user systems, because there is no way to know which user is currently logged in. Use xss-lock as an alternative for multi-user systems.