rustrix-term

Crates.iorustrix-term
lib.rsrustrix-term
version0.1.0
created_at2025-09-21 01:02:55.978657+00
updated_at2025-09-21 01:02:55.978657+00
descriptionTerminal animation that brings the iconic 'digital rain' effect from The Matrix Movie to your command line
homepage
repositoryhttps://github.com/hugomf/rustrix-term
max_upload_size
id1848342
size2,148,759
Hugo Fernandez (hugomf)

documentation

README

Rustrix / Matrix Animation 💻

A highly performant and customizable terminal animation that simulates the iconic "digital rain" effect from The Matrix. Built in Rust, this application leverages the crossterm and tokio libraries to create a smooth, responsive, and resource-efficient visual experience that reacts in real-time to terminal resizing and user input. This code is based on Matrix Animation golang version, see HuGoRain

A screenshot of the matrix code animation

✨ Features

  • Asynchronous: Built on the tokio runtime, ensuring a non-blocking and highly responsive animation loop.
  • Fully Customizable: Easily change the color theme, character set, speed, and density using command-line arguments.
  • Real-time Responsiveness: The animation dynamically adjusts to terminal resizing without a hitch.
  • Automatic Background Detection: The program can automatically detect your terminal's background color to create seamless, fading drop trails.
  • Multiple Character Sets: Choose from predefined sets like binary, emojis, or Kanji, or provide your own.

⚙️ How to Run

Prerequisites

Running from source

  1. Clone the repository:

    git clone https://github.com/hugomf/rustrix.git
    cd rustrix
    
  2. Run the application:

    cargo run --release
    

    Note: Using --release is highly recommended for optimal performance.

Command-line Flags

You can customize the animation using the following flags. Use --list to see all available options.

  • --color <NAME>

    • Sets the color theme.
    • Available Colors: green (default), amber, red, orange, blue, purple, cyan, pink, white.
    • Example: cargo run -- --color blue
  • --chars <NAME>

    • Specifies the character set to use.
    • Available Sets: matrix (default), binary, symbols, emojis, kanji, greek, cyrillic.
    • Example: cargo run -- --chars emojis
  • --speed <VALUE>

    • Controls the animation speed. Higher values mean faster animation.
    • Default: 5.0.
    • Example: cargo run -- --speed 20.0 (insanely fast)
  • --density <VALUE>

    • Adjusts the number of drops on the screen. Higher values result in more drops.
    • Default: 0.7.
    • Example: cargo run -- --density 1.5 (heavy density)
  • --background-color <R,G,B>

    • Manually sets the background color for accurate color fading. By default, it will attempt to detect the terminal's background color.
    • Example: cargo run -- --background-color 0,0,0 (black)
  • --list

    • Displays all available options and their values.
    • Example: cargo run -- --list

Example Usage

# Run with a fast, purple-colored binary drop
cargo run --release -- --color purple --chars binary --speed 10.0

# Run with a heavy density of Kanji characters
cargo run --release -- --chars kanji --density 1.2
Commit count: 13

cargo fmt