A Rust port of cmatrix with enhanced neural network weight visualization capabilities.
RMatrix creates a Matrix-like terminal effect with falling green characters, inspired by "The Matrix" movie. This Rust implementation adds support for visualizing neural network weights as the falling characters, making it both a screensaver and a data visualization tool.
- Matrix Rain Effect: Classic falling character animation
- Neural Network Weights: Display actual neural network weights instead of random characters
- Multiple Color Modes: Green, red, blue, white, yellow, cyan, magenta, rainbow
- Interactive Controls: Change colors, speed, and effects in real-time
- Cross-platform: Works on Linux, macOS, and Windows
- Screensaver Mode: Exits on first keystroke
- Lock Mode: Can be used as a screen lock
git clone <repository-url>
cd rmatrix
cargo build --releaseTo enable neural network model loading (optional):
cargo build --release --features neural# Default matrix effect
rmatrix
# With bold characters
rmatrix -b
# Screensaver mode
rmatrix -s
# Rainbow colors
rmatrix -r
# With custom message
rmatrix -M "Hello World"# Use weights from a file
rmatrix -w example_weights.txt
# With neural features enabled, load from Hugging Face model (future)
rmatrix -w gpt2 # (requires --features neural)Usage: rmatrix [OPTIONS]
Options:
-a, --asynch Asynchronous scroll
-b, --bold Bold characters on
-B, --all-bold All bold characters (overrides -b)
-c, --classic Use Japanese characters as seen in the original matrix
-f, --force Force the linux $TERM type to be on
-l, --linux Linux mode (uses matrix console font)
-L, --lock Lock mode (can be closed from another terminal)
-o, --oldstyle Use old-style scrolling
-n, --no-bold No bold characters (overrides -b and -B, default)
-s, --screensaver "Screensaver" mode, exits on first keystroke
-x, --xwindow X window mode
-k, --changes Characters change while scrolling
-r, --rainbow Rainbow mode
-m, --lambda Lambda mode
-u, --update <UPDATE> Screen update delay (0-10, default 4) [default: 4]
-C, --color <COLOR> Use this color for matrix (default green) [default: green]
-M, --message <MESSAGE> Message to display in center of screen
-w, --weights <WEIGHTS> Use neural network weights from file or model name
-h, --help Print help
-V, --version Print version
While running, you can use these keys to control the display:
q: Quit (unless in lock mode)a: Toggle asynchronous scrollingb: Enable some bold charactersB: Enable all bold charactersn: Disable bold charactersL: Enable lock moder: Toggle rainbow modem: Toggle lambda modep/P: Pause/unpause0-9: Change update speed!: Red color@: Green color#: Yellow color$: Blue color%: Magenta color^: Cyan color&: White color
Weight files should contain one floating-point number per line:
# Comments start with #
-2.341
1.892
-0.567
2.103
-1.234
The weights are converted to strings (e.g., "-2.34") and displayed character by character as the matrix rain.
rmatrix -lbarmatrix -s -w neural_weights.txtrmatrix -rm- Rust 1.70 or later
- For neural features: Additional ML dependencies
# Basic version
cargo build --release
# With neural network support
cargo build --release --features neuralThis project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Original cmatrix by Chris Allegretta
- Enhanced cmatrix (nnmatrix) with neural network features
- The Matrix movie for inspiration
- Rust community for excellent terminal libraries
Contributions are welcome! Please feel free to submit a Pull Request.