____________ _____________________
7 77 7 7 77 77 7 7
!__ __!| | | 7 || ___!| __!
7 7 | !___| | || 7___| |
| | | 7| ! || 7| 7 |
!__! !_____!!_____!!_____!!__!__!
π Lock your terminal. Unlock with your fingerprint.
A terminal lock screen for macOS that uses Touch ID for biometric unlock with macOS password fallback. Drop it into tmux as your lock-command and walk away.
![]() |
![]() |
![]() |
| Worms | DVD | Pipes |
![]() |
![]() |
|
| Passphrase | Touch ID |
- ποΈ Touch ID fingerprint unlock via macOS LocalAuthentication
- π macOS password fallback with blinking block cursor
- π¨ Glitch-style unicode bordered prompts (purple/teal palette)
- π§ Auto-detects Touch ID availability (skips when lid is closed)
- π‘οΈ Signal-proof β Ctrl+C, Ctrl+Z won't bypass the lock
- π Terminal resize aware
- π₯οΈ Designed as a tmux
lock-command
Grab the latest release for your architecture:
# Apple Silicon (M1/M2/M3/M4)
curl -sL https://github.com/retr0h/tlock/releases/latest/download/tlock_$(curl -sL https://api.github.com/repos/retr0h/tlock/releases/latest | grep tag_name | cut -d '"' -f4 | tr -d v)_darwin_arm64 -o tlock
# Intel Mac
curl -sL https://github.com/retr0h/tlock/releases/latest/download/tlock_$(curl -sL https://api.github.com/repos/retr0h/tlock/releases/latest | grep tag_name | cut -d '"' -f4 | tr -d v)_darwin_amd64 -o tlock
chmod +x tlock
sudo mv tlock /usr/local/bin/curl -sL https://github.com/retr0h/tlock/releases/latest/download/checksums.txt -o checksums.txt
grep "$(uname -s | tr A-Z a-z)_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" checksums.txt | sed 's/tlock_.*$/tlock/' | shasum -a 256 -cgit clone https://github.com/retr0h/tlock.git
cd tlock
go build -o tlock .
sudo mv tlock /usr/local/bin/Run directly:
tlock # Password prompt only
tlock --worms # Worms screensaver
tlock --pipes # Pipes screensaver
tlock --dvd # Bouncing lock screensaver
tlock --random # Random screensaver
tlock --random --cycle 5m # Rotate screensaver every 5 min
tlock --worms --delay 30s # Worms after 30s idleAs a tmux lock command:
# ~/.tmux.conf
set -g lock-command "tlock --random --cycle 5m"
set -g lock-after-time 1800 # Lock after 30 min idle
bind ^X lock-server # Ctrl+X to lock nowtlock brings the classic xlock experience to your terminal β an animated screensaver that kicks in when your terminal is locked, with authentication required to dismiss it.
- π¨ Pick a screensaver β
--worms,--pipes,--dvd(bouncing lock), or--random - β¨οΈ Any keypress pauses the screensaver and shows the passphrase prompt
- π Type your macOS password and press Enter to unlock
- ποΈ Press Esc to switch to Touch ID β authenticate with your fingerprint
- π« Wrong password? ACCESS DENIED β back to the screensaver
- π Cycle mode β
--random --cycle 5mrotates screensavers automatically
Without a screensaver flag, tlock shows the passphrase prompt directly.
All signals (SIGINT, SIGTERM, SIGTSTP) are ignored. The only way out is authentication. π
- π macOS (uses LocalAuthentication.framework and PAM)
- πΉ Go 1.21+ with CGo enabled
- ποΈ Touch ID hardware (optional β password fallback always available)
tlock is inspired by xlock, the classic X11 screen locker from the 90s that shipped with most Unix workstations. The worm screensaver mode (xlock -mode worm) by David Bagley was a staple of SGI Indigos and Sun workstations in dimly lit server rooms everywhere.
| Tool | Platform | Description |
|---|---|---|
| xlock / xlockmore | X11 / Unix | The OG screen locker with 50+ screensaver modes |
| vlock | Linux | Virtual console lock β locks Linux TTYs |
| bashlock | macOS / Linux | Simple bash-based terminal lock |
| slock | X11 | Suckless screen locker β minimal, no frills |
- πͺ± xlock-style worm screensaver with fading trails
- π Bouncing DVD padlock screensaver
- π² Pipes screensaver with fade-out reset
- π² Random screensaver selection with
--cyclerotation - π 1Password CLI integration
MIT - John Dewey




