Convert Figma logo to code with AI

abishekvashok logocmatrix

Terminal based "The Matrix" like implementation

3,966
412
3,966
64

Top Related Projects

A command line tool that recreates the famous data decryption effect seen in the 1992 movie Sneakers.

A good looking terminal emulator which mimics the old cathode display...

21,911

🖼️ A command-line system information tool written in bash 3.2+

Animated pipes terminal screensaver

4,126

Cross-platform Audio Visualizer

Quick Overview

CMatrix is a terminal-based "Matrix" screensaver that simulates the digital rain effect from the Matrix film series. It creates scrolling lines of random characters, giving the appearance of complex data streams. This project is a fork of the original cmatrix by Chris Allegretta, with additional features and improvements.

Pros

  • Customizable appearance with various color options and character sets
  • Lightweight and runs on most Unix-like systems
  • Supports different terminal types and sizes
  • Actively maintained with regular updates and bug fixes

Cons

  • Limited practical use beyond visual entertainment
  • May consume CPU resources when running for extended periods
  • Not available natively for Windows systems (requires WSL or Cygwin)
  • Some users may find the constantly changing display distracting

Getting Started

To install and run CMatrix on a Unix-like system:

# Install dependencies (example for Ubuntu/Debian)
sudo apt-get install libncurses5-dev

# Clone the repository
git clone https://github.com/abishekvashok/cmatrix.git

# Navigate to the project directory
cd cmatrix

# Build and install
autoreconf -i
./configure
make
sudo make install

# Run CMatrix
cmatrix

To customize the appearance, you can use various command-line options:

# Run with green text
cmatrix -C green

# Use bold characters
cmatrix -b

# Change scroll rate (1-10, default is 4)
cmatrix -s 7

# Use asynchronous scroll
cmatrix -a

For more options and detailed usage instructions, refer to the project's README file or run man cmatrix after installation.

Competitor Comparisons

A command line tool that recreates the famous data decryption effect seen in the 1992 movie Sneakers.

Pros of no-more-secrets

  • Focuses on recreating a specific movie effect, providing a unique and nostalgic experience
  • Offers a command-line tool that can be applied to various text inputs
  • Includes a library for integration into other projects

Cons of no-more-secrets

  • Limited in functionality compared to cmatrix's more versatile display options
  • May have fewer customization options for colors and display patterns
  • Less actively maintained, with fewer recent updates

Code Comparison

no-more-secrets:

void nms_set_foreground_color(char *color) {
    if (color == NULL || !strcmp(color, "default")) {
        *foreground_color = DFLT_FOREGROUND;
    } else {
        *foreground_color = color;
    }
}

cmatrix:

void matrix(int force_update) {
    static int *length = NULL;
    static int *spaces = NULL;
    static int *updates = NULL;
    int i, j, y;
    // ... (additional code)
}

The code snippets show that no-more-secrets focuses on color setting functionality, while cmatrix implements the core matrix display logic. cmatrix's code appears more complex, reflecting its broader feature set.

A good looking terminal emulator which mimics the old cathode display...

Pros of cool-retro-term

  • Offers a full-featured terminal emulator with customizable retro effects
  • Provides a rich, immersive visual experience with CRT-like display
  • Supports various color schemes and customization options

Cons of cool-retro-term

  • Requires more system resources due to its graphical nature
  • May have a steeper learning curve for configuration
  • Less focused on the specific "Matrix" effect

Code Comparison

cool-retro-term (QML):

Rectangle {
    id: frame
    anchors.fill: parent
    color: shadersettings.background_color
    opacity: shadersettings.window_opacity
}

cmatrix (C):

for (i = 0; i <= LINES; i++) {
    matrix[i] = (int *) malloc(COLS * sizeof(int));
    if (matrix[i] == NULL)
        bail_out(5);
    memset(matrix[i], 0, COLS * sizeof(int));
}

cool-retro-term is a more comprehensive terminal emulator with a focus on recreating the look and feel of old CRT displays. It offers a wide range of customization options and visual effects. On the other hand, cmatrix is a lightweight, focused application that simulates the "digital rain" effect from The Matrix. While cool-retro-term provides a full terminal experience, cmatrix is designed for a specific visual effect. The code snippets reflect this difference, with cool-retro-term using QML for its graphical interface and cmatrix using C for its text-based implementation.

21,911

🖼️ A command-line system information tool written in bash 3.2+

Pros of neofetch

  • Provides comprehensive system information in a visually appealing format
  • Highly customizable with various display options and themes
  • Supports a wide range of operating systems and distributions

Cons of neofetch

  • Requires more system resources to run compared to cmatrix
  • May display sensitive information if not configured properly
  • Less visually dynamic than cmatrix's scrolling effect

Code comparison

neofetch:

#!/usr/bin/env bash
# Neofetch config file
print_info() {
    info title
    info underline
}

cmatrix:

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
    matrix_init(matrix_opts);
}

Summary

neofetch is a feature-rich system information tool that offers detailed insights and customization options. It's ideal for users who want to quickly gather and display system data. On the other hand, cmatrix provides a visually engaging Matrix-like animation, which is more suited for entertainment or creating a futuristic ambiance. While neofetch is more practical for system diagnostics, cmatrix excels in creating a unique visual experience with minimal resource usage.

Animated pipes terminal screensaver

Pros of pipes.sh

  • More customizable with various options for pipe styles, colors, and animation speed
  • Lighter on system resources, making it suitable for older or less powerful machines
  • Easier to install and run without compilation requirements

Cons of pipes.sh

  • Less iconic and recognizable compared to the "Matrix" style effect
  • Limited to pipe-like patterns, which may not be as visually striking
  • Lacks some advanced features like custom text input or screensaver mode

Code Comparison

pipes.sh:

#!/usr/bin/env bash
# Animated pipes terminal screensaver
# ...
p=1
f=75 s=13 r=2000 t=0
w=$(tput cols) h=$(tput lines)
# ...

cmatrix:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
// ...

pipes.sh is written in Bash, making it more accessible and easier to modify for users familiar with shell scripting. cmatrix is written in C, which allows for more complex operations and potentially better performance but requires compilation.

Both projects aim to create visually appealing terminal-based animations, with pipes.sh focusing on customizable pipe patterns and cmatrix recreating the iconic "digital rain" effect from The Matrix.

4,126

Cross-platform Audio Visualizer

Pros of cava

  • Real-time audio visualization with colorful, customizable bars
  • Supports multiple audio sources and output methods
  • More dynamic and interactive visual experience

Cons of cava

  • Requires audio input to function, unlike cmatrix's standalone visual effect
  • More complex setup and configuration
  • Higher system resource usage due to audio processing

Code comparison

cava (config file):

[color]
background = default
foreground = cyan

cmatrix (command-line options):

cmatrix -C cyan

Summary

cava offers a more advanced and interactive audio visualization experience, while cmatrix provides a simpler, standalone visual effect. cava's pros include real-time audio responsiveness and customizable visualizations, but it comes with the cons of more complex setup and higher resource usage. cmatrix, on the other hand, is easier to use and lighter on system resources but lacks the dynamic audio-responsive features of cava.

The code comparison shows that cava uses a configuration file for customization, while cmatrix relies on command-line options for similar adjustments. This reflects the difference in complexity and flexibility between the two projects.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CMatrix

Matrix like effect in your terminal

-----------------------------------------------------

Contents

-----------------------------------------------------

:cloud: Overview

CMatrix is based on the screensaver from The Matrix website. It shows text flying in and out in a terminal like as seen in "The Matrix" movie. It can scroll lines all at the same rate or asynchronously and at a user-defined speed.

CMAtrix is inspired from 'The Matrix' movie. If you haven’t seen this movie and you are a fan of computers or sci-fi in general, go see this movie!!!

:grey_exclamation:Disclaimer : We are in no way affiliated in any way with the movie "The Matrix", "Warner Bros" nor any of its affiliates in any way, just fans.

-----------------------------------------------------

:open_file_folder: Build Dependencies

You'll probably need a decent ncurses library to get this to work. On Windows, using mingw-w64-ncurses is recommended (PDCurses will also work, but it does not support colors or bold text).

:small_blue_diamond: For Linux

Run this command to check the version of ncurses.

ldconfig -p | grep ncurses

If you get no output then you need to install ncurses. Click below to install ncurses in Linux.

-----------------------------------------------------

:floppy_disk: Building and installing cmatrix

To install cmatrix, Clone this repo in your local system and use either of the following methods from within the cmatrix directory.

:small_blue_diamond: Using configure (recommended for most linux/mingw users)

autoreconf -i  # skip if using released tarball
./configure
make
make install

:small_blue_diamond: Using CMake

Here we also show an out-of-source build in the sub directory "build". (Doesn't work on Windows, for now).

mkdir -p build
cd build
# to install to "/usr/local"
cmake ..
# OR 
# to install to "/usr"
#cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
make install

-----------------------------------------------------

:bookmark_tabs: Usage

After you have installed cmatrix just type the command cmatrix to run it :)

cmatrix

Run with different arguments to get different effects.

cmatrix [-abBflohnsmVx] [-u update] [-C color]

Example:

cmatrix -ba -u 2 -C red

For more options and help run cmatrix -h
OR
Read Manual Page by running command man cmatrix

To get the program to look most like the movie, use cmatrix -lba To get the program to look most like the Win/Mac screensaver, use cmatrix -ol

:round_pushpin: Note: cmatrix is probably not particularly portable or efficient, but it won't hog too much CPU time.

-----------------------------------------------------

:camera: Captures

:small_blue_diamond: Screenshots

cmatrix screenshot

:small_blue_diamond: Screencasts

cmatrix screencast

-----------------------------------------------------

:zap: Maintainers

:busts_in_silhouette: Our Contributors

:small_orange_diamond: Thanks to

  • ➤ Chris Allegretta chrisa@asty.org for writing cmatrix up in a fortnight and giving us the responsibility to further improve it.
  • ➤ Krisjon Hanson and Bjoern Ganslandt for helping with bold support and Bjoern again for the cursor removal code, helping with the -u and -l modes/flags, and Makefile improvements.
  • ➤ Adam Gurno for multi-color support.
  • ➤ Garrick West for debian consolefont dir support.
  • ➤ Nemo for design thoughts and continuous help and support.
  • ➤ John Donahue for helping with transparent term support
  • ➤ Ben Esacove for Redhat 6 compatibility w/matrix.psf.gz
  • ➤ jwz for the xmatrix module to xscreensaver at http://www.jwz.org/xscreensaver.
  • Chris Allegretta's girlfriend Amy for not killing him when he stayed up till 3 AM writing code.
  • ➤ Sumit Kumar Soni for beautifying the README.
  • The makers of the Matrix for one kickass movie!
  • ➤ Everyone who has sent (and who will send) us and Chris mails regarding bugs, comments, patches or just a simple hello.
  • ➤ Everyone who has contributed to the project by opening issues and PRs on the github repository.

-----------------------------------------------------

:book: Contribution Guide

If you have any suggestions/flames/patches to send, please feel free to:

  • Open issues and if possible label them, so that it is easy to categorise features, bugs etc.
  • If you solved some problems or made some valuable changes, Please open a Pull Request on Github.
  • See contributing.md for more details.

-----------------------------------------------------

:page_facing_up: License

This software is provided under the GNU GPL v3. View License