Skip to content

not so simple opengl based X display locker utility

License

Notifications You must be signed in to change notification settings

intmainreturnzero/gllock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is a fork of https://github.com/kuravih/gllock without the heavy gif images

gllock

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.

Requirements

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.

Installation

Edit config.mk 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" &

Note

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

About

not so simple opengl based X display locker utility

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 65.2%
  • GLSL 27.1%
  • Makefile 7.4%
  • Shell 0.3%