slock

Kris's build of slock (slock-flexipatch)
git clone git clone https://git.krisyotam.com/krisyotam/slock.git
Log | Files | Refs | README | LICENSE

README.md (3564B)


      1 # Kris's build of slock (flexipatch)
      2 
      3 My build of [slock](https://tools.suckless.org/slock/), the simple X display locker.
      4 
      5 This build is based on [slock-flexipatch](https://github.com/bakkeby/slock-flexipatch), which uses preprocessor directives to manage patches. This allows easy toggling of features without manual patching.
      6 
      7 ---
      8 
      9 ## How Patches Work (Preprocessor Directives)
     10 
     11 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):
     12 
     13 ```c
     14 #define DPMS_PATCH 1       /* enabled */
     15 #define DWM_LOGO_PATCH 0   /* disabled */
     16 ```
     17 
     18 Then rebuild:
     19 ```bash
     20 sudo make clean install
     21 ```
     22 
     23 All patch options are documented in `patches.h`.
     24 
     25 ---
     26 
     27 ## Available Patches
     28 
     29 This is currently a **vanilla build** with no patches enabled. The following patches are available to toggle on in `patches.h`:
     30 
     31 | Patch | Description |
     32 |-------|-------------|
     33 | alpha | Transparency support (pair with a compositor for blur) |
     34 | auto_timeout | Run a command after a specified period of inactivity |
     35 | background_image | Custom background image on lock screen (requires Imlib2) |
     36 | blur_pixelated_screen | Blur/pixelate a screenshot as the lock background (requires Imlib2) |
     37 | capscolor | Additional color to indicate Caps Lock state |
     38 | color_message | Lock screen message with 24-bit ANSI color codes (requires Xinerama) |
     39 | controlclear | Suppress failure color on control key presses with empty buffer |
     40 | dpms | Auto shut off monitor after configurable inactivity |
     41 | dwm_logo | Draw the dwm logo, color changes with state |
     42 | failure_command | Run a command after N incorrect password attempts |
     43 | keypress_feedback | Random blocks on screen as keypress feedback |
     44 | mediakeys | Allow media keys (volume, skip) while locked |
     45 | message | Display a text message on the lock screen (requires Xinerama) |
     46 | pamauth | PAM authentication instead of shadow (default config for Arch) |
     47 | quickcancel | Cancel lock by moving mouse within a time window |
     48 | secret_password | Execute commands on special password entry |
     49 | terminalkeys | Terminal-style key bindings (Ctrl+U, etc.) for password input |
     50 | unlockscreen | Keep screen visible but lock input |
     51 | visual_unlock | `-u` flag to lock input without showing lock screen |
     52 | xresources | Read colors from Xresources |
     53 
     54 ---
     55 
     56 ## Installation
     57 
     58 ```bash
     59 git clone https://github.com/krisyotam/slock
     60 cd slock
     61 sudo make clean install
     62 ```
     63 
     64 ---
     65 
     66 ## Configuration
     67 
     68 ### Enabling/Disabling Patches
     69 
     70 Edit `patches.h` to toggle patches:
     71 
     72 ```c
     73 #define CAPSCOLOR_PATCH 1    /* Enable caps lock color */
     74 #define DPMS_PATCH 1         /* Enable monitor power management */
     75 ```
     76 
     77 ### Customizing Settings
     78 
     79 Edit `config.def.h` for:
     80 - Lock screen colors
     81 - User/group settings
     82 - Patch-specific options (timeouts, messages, etc.)
     83 
     84 After editing, rebuild:
     85 ```bash
     86 rm config.h && sudo make clean install
     87 ```
     88 
     89 ---
     90 
     91 ## My Other Suckless Repos
     92 
     93 - [dwm](https://github.com/krisyotam/dwm) - dynamic window manager
     94 - [st](https://github.com/krisyotam/st) - simple terminal
     95 - [dmenu](https://github.com/krisyotam/dmenu) - application launcher
     96 - [dwmblocks](https://github.com/krisyotam/dwmblocks) - modular status bar
     97 
     98 ---
     99 
    100 ## Credits
    101 
    102 - Based on [slock-flexipatch](https://github.com/bakkeby/slock-flexipatch) by bakkeby
    103 - [suckless.org](https://tools.suckless.org/slock/) for the original slock
    104 
    105 ---
    106 
    107 ## Contact
    108 
    109 - Kris Yotam <krisyotam@protonmail.com>
    110 - [https://krisyotam.com](https://krisyotam.com)