A terminal GIF renderer. Inspired by nyancat-cli.
Action | Demo |
---|---|
Default (./mumumu ) |
|
Load customized config (e.g., ./mumumu -c config.json -g kita-kirakira ) |
|
Terminal resize |
# 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
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
},
...
]
- Supporting three rendering modes: ascii, braille, halfblock
- Center align when rendering gif
- Customizable message for rendering gif
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
- config file
- gif infos array
- repeat or not
- gif infos array
Fonts below are tested and work well.
- Nerd font patch for JetBrainsMono
- CaskaydiaCove NF
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 |
---|---|
Some reference: