Skip to content
not so simple opengl based X display locker utility
Branch: master
Clone or download
Pull request Compare This branch is 7 commits ahead of anekos:master.
kuravih Merge pull request #5 from Wolfchin/master
Fix segfault at password verification
Latest commit c77658b Jun 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
images initial gllock commit May 19, 2019
shaders initial gllock commit May 19, 2019
.gitignore initial gllock commit May 19, 2019
LICENSE initial gllock commit May 19, 2019
Makefile initial gllock commit May 19, 2019 Update Jun 8, 2019
common.c initial gllock commit May 19, 2019
common.h initial gllock commit May 19, 2019 Fix SHADER_LOCATION Jun 9, 2019
gllock.c fix segfault at password verification Jun 9, 2019
install initial gllock commit May 19, 2019


OpenGL extension to the simple screen locker slock

Inspired by this reddit post this lock screen was implemented using the simplest lock program I could find. gllock will obscure the screen using an opengl texture shader.

few examples







In order to build gllock you need the following packages:

  • x11proto-core-dev for #include <X11/keysym.h>
  • libx11-dev for #include <X11/Xlib.h>
  • libglew-dev for #include <GL/glew.h>

The other requirement will be fulfilled automatically when installing the above.


Edit to match your local setup (gllock is installed into the /usr/local namespace by default).

  • SHADER_LOCATION - location of the shader files (default ~/.gllock/ which is a symlink to the shader folder of the repository)
  • FRGMNT_SHADER - the shader file to use (default circle.fragment.glsl)

The following command builds and installs gllock:

> sudo make clean install

Running gllock

Simply invoke the 'gllock' command. To get out of it, enter your password. However the typical setup involves using gllock with xautolock. For example in order to run gllock after N minutes of inactivity the following command may be used.

> sudo xautolock -time N -locker "gllock" &


when using a particular fragment shader you may want to figure out the supported glsl version for your system using

> glxinfo | grep 'version'

as explained here and then make the necessary modifications to the shader files.

Most opengl texture shaders from Shadertoy may be adapted to gllock with minimal modifications. You may use the following substitutions as a starting point.

  • use uniform vec2 screenSize for uniform vec3 iResolution : viewport resolution pixels. (i.e. iResolution.xy -> screenSize).

  • use uniform float time for uniform float iTime : shader playback time seconds. (i.e. iTime -> time);

  • use uniform sampler2D imageData for uniform samplerXX iChannel0..3 : input texture channel. (i.e. iChannel0 -> imageData);

  • use void main(void) for void mainImage( out vec4 fragColor, in vec2 fragCoord ) for the main function (i.e. void mainImage(out vec4 fragColor, in vec2 fragCoord) -> void main(void)); fragCoord -> gl_FragCoord implicit input fragColor -> gl_FragColor implicit output

You can’t perform that action at this time.