Stable

garlock

Screen Locker

A secure PAM-authenticated screen locker with blurred screenshot backgrounds and visual ring feedback. garlock provides comprehensive input protection with keyboard/pointer grabs and secure password handling using memory zeroing.

Features

  • PAM authentication with configurable service
  • Secure password handling with zeroize memory clearing
  • Blurred screenshot background for privacy
  • Animated ring indicator with 5 visual states
  • Multi-monitor support via RandR
  • Caps Lock and failed attempt warnings
  • Configurable cooldown after failed attempts
  • Daemon mode with IPC socket control
  • Time display with strftime formatting
  • Full Unicode password input support
  • Keyboard and pointer grab for security
  • TOML configuration at ~/.config/garlock/config.toml

Security Model

Memory Security

Passwords zeroed from memory using zeroize crate. No password remnants after authentication.

Input Grabbing

X11 keyboard and mouse grabbed. No input reaches other applications during lock.

PAM Integration

Uses system PAM stack. Same authentication as system login, supports 2FA and custom modules.

Quick Start Guide

Get garlock installed and configured for secure screen locking.

1. Installation

Install garlock using the unified installer or build from source:

terminal
$ curl -fsSL https://gar.musicsian.com/install.sh | bash -s -- --component=garlock # Install via script
$ cd ~/.local/src/gardesk/garlock && cargo build --release # Or build from source

2. PAM Configuration

Create a PAM service file for garlock (requires root):

/etc/pam.d/garlock
#%PAM-1.0
# PAM configuration for garlock screen locker

auth required pam_unix.so
terminal
$ sudo tee /etc/pam.d/garlock << "EOF" #%PAM-1.0 auth required pam_unix.so EOF # Create PAM service file
$ sudo chmod 644 /etc/pam.d/garlock # Set permissions

3. Running garlock

Lock your screen directly or run in daemon mode:

terminal
$ garlock # Lock screen directly
$ garlock lock # Explicit lock command
$ garlock daemon & # Start daemon mode
$ garlock lock # Lock via daemon

4. Integration with gar

Bind a key in gar to lock the screen:

~/.config/gar/init.lua
-- Lock screen with Super+L
gar.bind("mod+l", "exec garlock")

-- Or lock via shell command
gar.bind("mod+l", function()
    gar.exec("garlock lock")
end)

5. Configuration

Create a configuration file at ~/.config/garlock/config.toml:

terminal
$ mkdir -p ~/.config/garlock # Create config directory
$ $EDITOR ~/.config/garlock/config.toml # Edit configuration

6. Testing

Test garlock safely with Xephyr:

terminal
$ Xephyr :1 -screen 1920x1080 & # Start nested X server
$ DISPLAY=:1 garlock # Test garlock in Xephyr

Warning: When testing on your main display, ensure you have TTY access (Ctrl+Alt+F2) as a backup in case of issues.

Releases