Skip to content

gsastry0/rmatrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RMatrix

A Rust port of cmatrix with enhanced neural network weight visualization capabilities.

Overview

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.

Features

  • 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

Installation

From Source

git clone <repository-url>
cd rmatrix
cargo build --release

With Neural Network Support

To enable neural network model loading (optional):

cargo build --release --features neural

Usage

Basic Usage

# Default matrix effect
rmatrix

# With bold characters
rmatrix -b

# Screensaver mode
rmatrix -s

# Rainbow colors
rmatrix -r

# With custom message
rmatrix -M "Hello World"

Neural Network Weights

# 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)

Command Line Options

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

Interactive Controls

While running, you can use these keys to control the display:

  • q: Quit (unless in lock mode)
  • a: Toggle asynchronous scrolling
  • b: Enable some bold characters
  • B: Enable all bold characters
  • n: Disable bold characters
  • L: Enable lock mode
  • r: Toggle rainbow mode
  • m: Toggle lambda mode
  • p/P: Pause/unpause
  • 0-9: Change update speed
  • !: Red color
  • @: Green color
  • #: Yellow color
  • $: Blue color
  • %: Magenta color
  • ^: Cyan color
  • &: White color

Neural Network Weight Files

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.

Examples

Classic Matrix Look

rmatrix -lba

Screensaver with Weights

rmatrix -s -w neural_weights.txt

Rainbow Lambda Mode

rmatrix -rm

Building

Dependencies

  • Rust 1.70 or later
  • For neural features: Additional ML dependencies

Compile

# Basic version
cargo build --release

# With neural network support
cargo build --release --features neural

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Acknowledgments

  • Original cmatrix by Chris Allegretta
  • Enhanced cmatrix (nnmatrix) with neural network features
  • The Matrix movie for inspiration
  • Rust community for excellent terminal libraries

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

rust port of cmatrix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages