Skip to content

Project

pmatrix

An alternative to the famous cmatrix C++ program written in Python

Python60Updated Jun 2026
View on GitHub ↗

PMatrix

Python 3.11+ License: MIT Sponsor

A Matrix digital rain effect terminal application, written in Python


Overview

This program creates a digital rain effect, similar to the iconic Matrix movie visuals, with falling characters in the terminal. Written in modern Python with improved features including variable drop speeds, intensity-based coloring, and optimized rendering.

Features

  • Dynamic drop speeds: Each drop falls at a random speed for more variety
  • Intensity-based coloring: Leading characters are brighter green
  • Smooth animations: Optimized rendering at ~30 FPS
  • Terminal resize support: Automatically adjusts to window size changes
  • Graceful shutdown: Handles Ctrl+C cleanly
  • No external dependencies: Uses Python standard library only

Running

Execute without installing using nix run, uvx, or the container image:

1nix run github:4ster-light/pmatrix
1uvx git+https://github.com/4ster-light/pmatrix
1docker run -it --rm ghcr.io/4ster-light/pmatrix

Installation

1nix profile add github:4ster-light/pmatrix

Or add the flake to your system config if you use NixOS.

Using UV

1uv tool install git+https://github.com/4ster-light/pmatrix

Using pip

1pip install git+https://github.com/4ster-light/pmatrix

Podman/Docker

1docker pull ghcr.io/4ster-light/pmatrix

Build from source

1git clone https://github.com/4ster-light/pmatrix.git2cd pmatrix3nix build .#container4docker load < result5docker run -it --rm pmatrix

This will build the container image and run it interactively in your terminal using the provided image in the nix flake.

[!NOTE] The container OCI image is built using Nix, so you will need Nix installed to build it. You may load it with either Podman or Docker.

Requirements

  • Python 3.11 or later
  • A terminal that supports ANSI escape codes (most modern terminals)
  • Linux, macOS, or compatible terminal

License

MIT

Want to see more? Visit my GitHub profile for all of my repositories and contributions.

View all repositories on GitHub