Skip to content

oditynet/Xlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xlock

Screensaver with minimal features. Supports only X11.

Implemented:

  1. Integration with D-Bus
  2. Graphical locking (Creates a fullscreen window with the override_redirect flag. Grabs the keyboard with XGrabKeyboard.)
  3. Working with xss-lock

Running on i3:

exec --no-startup-id xss-lock -- Xlock

Build:

gcc xlock.c -o xlock -lX11 -ldbus-1 -I /usr/include/dbus-1.0/ -I /usr/lib32/dbus-1.0/include/

Font:

xlsfonts | grep courier

Version 2:

gcc Xlock_v2.c -o Xlock_v2 -lX11 -ldbus-1 -lXft -I /usr/include/dbus-1.0/ -I /usr/lib32/dbus-1.0/include/ -I/usr/include/freetype2/

Version 3:

Added time, keyboard layout, and background photo output.

gcc Xlock_v3.c -o Xlock -lX11 -lXft -lImlib2 -lxkbfile -ldbus-1 -I /usr/include/dbus-1.0/ -I /usr/lib32/dbus-1.0/include/ -I /usr/include/freetype2/

Take a screen /home/user/.i3/lock.sh:

#!/bin/bash
#Make screenshot
scrot /tmp/screen.png
# Scale image
convert -scale 10% -scale 1000% /tmp/screen.png /tmp/screen1.png
./Xlock

bindsym Mod1+ctrl+l exec /home/user/.i3/lock.sh

Mega idea

You left your computer and your colleagues came to you, but they don't know where you are. Your monitor is on and there is a qrcode on it. The employee scans it and it forwards it to dial your number or to TG or other networks.

61.py is very smart: it analyzes where it will put its pixel from the qrcode and if the background is dark, then the color of the dot inverts.