Replace upstream README with personal build README
Visual unlock - adding command line argument to help output and correcting typo ref. #14
Adding visual unlock patch ref. #14
My build of slock, the simple X display locker.
This build is based on slock-flexipatch, which uses preprocessor directives to manage patches. This allows easy toggling of features without manual patching.
Unlike traditional slock patching, this build uses C preprocessor directives to include/exclude patches at compile time. To enable or disable a patch, edit patches.h and set the value to 1 (enabled) or 0 (disabled):
#define DPMS_PATCH 1 /* enabled */
#define DWM_LOGO_PATCH 0 /* disabled */
Then rebuild:
sudo make clean install
All patch options are documented in patches.h.
This is currently a vanilla build with no patches enabled. The following patches are available to toggle on in patches.h:
| Patch | Description |
|---|---|
| alpha | Transparency support (pair with a compositor for blur) |
| auto_timeout | Run a command after a specified period of inactivity |
| background_image | Custom background image on lock screen (requires Imlib2) |
| blur_pixelated_screen | Blur/pixelate a screenshot as the lock background (requires Imlib2) |
| capscolor | Additional color to indicate Caps Lock state |
| color_message | Lock screen message with 24-bit ANSI color codes (requires Xinerama) |
| controlclear | Suppress failure color on control key presses with empty buffer |
| dpms | Auto shut off monitor after configurable inactivity |
| dwm_logo | Draw the dwm logo, color changes with state |
| failure_command | Run a command after N incorrect password attempts |
| keypress_feedback | Random blocks on screen as keypress feedback |
| mediakeys | Allow media keys (volume, skip) while locked |
| message | Display a text message on the lock screen (requires Xinerama) |
| pamauth | PAM authentication instead of shadow (default config for Arch) |
| quickcancel | Cancel lock by moving mouse within a time window |
| secret_password | Execute commands on special password entry |
| terminalkeys | Terminal-style key bindings (Ctrl+U, etc.) for password input |
| unlockscreen | Keep screen visible but lock input |
| visual_unlock | -u flag to lock input without showing lock screen |
| xresources | Read colors from Xresources |
git clone https://github.com/krisyotam/slock
cd slock
sudo make clean install
Edit patches.h to toggle patches:
#define CAPSCOLOR_PATCH 1 /* Enable caps lock color */
#define DPMS_PATCH 1 /* Enable monitor power management */
Edit config.def.h for:
After editing, rebuild:
rm config.h && sudo make clean install