A Matrix-style digital rain animated desktop wallpaper written in Rust. A falling stream of characters renders in each column of the screen, leaving glyphs behind at fixed positions as the lead character descends. Characters near the head rotate quickly, fade gradually, and occasionally flash bright before dimming back into the trail. Runs as a non-interactive background window via xwinwrap and alacritty at 24 fps.
These instructions assume Rust is already installed on your system. If not, visit rust-lang.org and follow the instructions there.
xwinwrap hosts the terminal emulator as a desktop-level window that sits behind all other windows and ignores mouse/keyboard input. Build it from source:
sudo apt install libx11-dev libxrender-dev libxext-dev
git clone https://github.com/mmhobi7/xwinwrap
cd xwinwrap
make
sudo make installAlacritty is the terminal emulator used to render the animation. Visit alacritty.org for full documentation.
sudo add-apt-repository ppa:aslatter/ppa
sudo apt update
sudo apt install alacrittyThe wallpaper uses the Matrix Code NFI font.
- Download it from dafont.com/matrix-code-nfi.font
- Extract the zip and double-click the
.ttffile - Click Install in the font preview window that opens
git clone https://github.com/Kenneth-Posey/rust-digital-rain.git
cd rust-digital-rain
cargo build --releasebash launch.shThe script builds the binary (if not already built), then launches xwinwrap with alacritty embedded as a borderless, non-interactive desktop background window. The process will appear as digital-rain in your process explorer.
bash stop.shlaunch.sh passes all animation parameters as explicit CLI flags — edit the values there to adjust the defaults:
| Flag | Default | Description |
|---|---|---|
--speed |
1.0 |
Column fall speed multiplier |
--fps |
24 |
Target frame rate |
--trail-length |
60 |
Maximum trail length in rows |
--flash-chance |
5 |
Chance (0–100) per tick a glyph flashes bright |
--rotation-speed |
1.0 |
Glyph rotation speed multiplier |
--config |
(none) | Path to a YAML config file enabling source-code rain mode |
--check |
— | Load config, print path diagnostics to stdout, then exit |
Instead of random glyphs, the rain can display real lines of source code read from your own projects. Each column is assigned one line from a source file; characters spin randomly as the head falls, then snap to the correct character once they settle. Keyword characters (e.g. fn, class, return) are highlighted in bright white-green — the same color as the leading glyph — when keyword highlighting is enabled. Digit characters (0–9) can be highlighted the same way with highlight_numbers: true. Documentation comment lines are filtered out and never shown.
# Extensions to include when scanning directories (global)
extensions:
- rs
- py
- ts
# One entry per directory; options are per-path
paths:
- path: /path/to/my/project/src
highlight_keywords: true # brighter color for language keywords
highlight_numbers: true # brighter color for digit characters
- path: /path/to/other/project
highlight_keywords: true
highlight_numbers: false
# Doc-comment prefixes per language — matching lines are skipped entirely.
# Multiple prefixes are comma-separated.
doc_comments:
rust: "///, //, //!"
python: "\"\"\", '''"
# … see config.yml for the full list
# Keyword lists — applied when highlight_keywords is true.
# Keys are language names (rust, python, javascript, etc.)
keywords:
rust: "fn, pub, async" # … see config.yml for the full listJava, Kotlin, C#, Rust, Python, JavaScript, TypeScript, F#, Haskell, Swift, Clojure, PHP, COBOL, Visual Basic / VB.NET, SQL, C++, C, Ruby, Dart, R, Go.
To add directories from private projects without committing them, create a config.secret.yml file in the same directory as config.yml. It uses the exact same format and is automatically merged at startup. It is already listed in .gitignore.
touch config.secret.ymlpaths:
- path: /home/you/work/my-private-repo/src
highlight_numbers: true
highlight_keywords: true
- path: /home/you/personal/side-project
highlight_numbers: true
highlight_keywords: false3. Run as normal — your private paths will be included in the file rotation alongside the public ones
bash launch.sh