Skip to content

nglain-dev/matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Matrix Rain Screensaver for tmux

Authentic Matrix digital rain effect as a tmux screensaver. Activates automatically after idle timeout.

Matrix

Quick Setup (Recommended)

Option 1: Glitch Mode (Best Visual Effect)

Uses encoding hack to create authentic glitchy Matrix effect:

# Install cmatrix
apt install cmatrix

# Create glitch wrapper
cat > /usr/local/bin/cmatrix-glitch << 'EOF'
#!/bin/bash
# Force broken encoding for glitch effect
LC_ALL=C cmatrix -c "$@"
EOF
chmod +x /usr/local/bin/cmatrix-glitch

# Add to ~/.tmux.conf
echo '
set -g lock-after-time 60
set -g lock-command "cmatrix-glitch -s -b -u 4"
' >> ~/.tmux.conf

# Reload
tmux source-file ~/.tmux.conf

Option 2: Standard cmatrix

# Install
apt install cmatrix

# Add to ~/.tmux.conf
echo '
set -g lock-after-time 60
set -g lock-command "cmatrix -s -b -u 4"
' >> ~/.tmux.conf

# Reload
tmux source-file ~/.tmux.conf

Flags:

  • -s — screensaver mode (any key to exit)
  • -b — bold characters
  • -u 4 — update delay (1-9, higher = slower)
  • -c — Japanese katakana characters

How Glitch Mode Works

The glitch effect is achieved through an encoding hack:

LC_ALL=C cmatrix -c
  1. -c enables Japanese katakana characters (wide characters)
  2. LC_ALL=C forces basic C locale (breaks UTF-8)
  3. Terminal can't render wide chars properly → glitch effect

Alternative: Bash Script

Included matrix.sh for systems without cmatrix:

# Download
curl -o ~/.local/bin/matrix.sh https://raw.githubusercontent.com/nglain/matrix/main/matrix.sh
chmod +x ~/.local/bin/matrix.sh

# Add to ~/.tmux.conf
set -g lock-after-time 60
set -g lock-command '~/.local/bin/matrix.sh'

Configuration

# Change timeout (seconds)
set -g lock-after-time 120  # 2 minutes

# Disable
set -g lock-after-time 0

Other Cool Screensavers

Name Install tmux lock-command Description
cmatrix apt install cmatrix cmatrix -s -b Matrix rain
cmatrix-glitch see above cmatrix-glitch -s -b -u 4 Glitchy Matrix
pipes.sh apt install pipes.sh pipes.sh Animated pipes
cbonsai apt install cbonsai cbonsai -l -i -w 5 Growing bonsai tree
asciiquarium apt install asciiquarium asciiquarium Aquarium with fish
tty-clock apt install tty-clock tty-clock -s -c Terminal clock

License

MIT

About

Matrix rain screensaver for tmux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages