Difference between revisions of "Slock"

From ArchWiki
Jump to navigation Jump to search
m (added a small amount of info about slock; the description was bare)
Line 1: Line 1:
[[Category:X server]]
[[Category:X server]]
Slock is the "Simple X display locker" [http://tools.suckless.org/slock/].
Slock, or the "Simple X display locker", is a display locker for [[X]] that aims to be minimal, fast, and
== Installation ==
== Installation ==

Revision as of 06:21, 24 March 2019

Slock, or the "Simple X display locker", is a display locker for X that aims to be minimal, fast, and lightweight.[1].


Install the slock or slock-gitAUR package.


Configuration is done by editing the config.h header file and then recompiling the package. After configuration you should create a package.


Simply run slock to lock the screen. You can also provide an argument to be run after the screen has been locked:

$ slock cmd [arg ...]

Tips and tricks

Lock on suspend

Create the following service which turns off the monitor and locks the screen.

Description=Lock X session using slock for user %i

ExecStartPre=/usr/bin/xset dpms force suspend


Enable the slock@user.service systemd unit for it to take effect for the username user.

Block VT switching and prevent killing X

slock recommends blocking VT switching so that the screen lock cannot be bypassed. For the same reason, slock recommends preventing users from killing the X server. See Xorg#Block TTY access and Xorg#Prevent a user from killing X.

See also