Skip to content

a45s67/mumumu

Repository files navigation

Mumumu

A terminal GIF renderer. Inspired by nyancat-cli.

Demo

Action Demo
Default (./mumumu) demo!
Load customized config (e.g., ./mumumu -c config.json -g kita-kirakira) demo
Terminal resize demo

Usage

# build 
go run mumumu

# show help
./mumumu -h

Usage of ./mumumu:
  -c string
        Config file path. (default "config.json")
  -g string
        Load the gif setting in config file. (default "mumumu")

# Start mumumu (Equal to ./mumumu -c config.json -g mumumu)
./mumumu

# Render other gif (e.g., "kite-kirakira" in config.json)
./mumumu -c config.json -g kita-kirakira

Configure

I predefined many gif settings in config.json. Ones can check it and give it a try.

config.json

[
    {
        "name": "mumumu", // This gif setting name
        "path": "https://media.tenor.com/nIfKxqBUqQQAAAAC/shake-head-anime.gif", // Support url or file path
        "flags": {
            "color": true, // Color or gray scale
            "mode": "braille" // Support three modes: "halfblock" render with ▀, "braille" render with ⣿, "ascii" render with asciis
            "threshold": 50, // Gray scale threashold 0-255
            "maxwidth": 100 // Max width (in char length) when rendering in terminal
        },
        "message": "You have mumumued for %d seconds..." // Message below the rendered git in terminal
    },
    ...
]

Feature

  • Supporting three rendering modes: ascii, braille, halfblock
  • Center align when rendering gif
  • Customizable message for rendering gif

Login theme

You can set mumumu as first command in your shell rc file. For example, I set this command in my .zprofile file:

~/projects/mumumu/mumumu -c ~/projects/mumumu/config.json -g kita-kirakira

Reference

TODO

  • config file
    • gif infos array
      • repeat or not

Support Fonts

Fonts below are tested and work well.

  • Nerd font patch for JetBrainsMono
  • CaskaydiaCove NF

Troubleshooting

If you find the color rendered on terminal is not correct, check whether the true color mode is enabled.

# in .zshrc
export COLORTERM=truecolor

# in .tmux.conf
set -g default-terminal "xterm-256color"

You can check whether the true color is enabled successfully with rich.

True color enabled True coloe not enabled
demo! demo!

Some reference:

Reference

Releases

No releases published

Packages

No packages published

Languages