abishekvashok / cmatrix

Terminal based "The Matrix" like implementation
GNU General Public License v3.0
4.05k stars 421 forks source link

On using `-l`, `setfont` and custom fonts in Ubuntu (and possibly Debian) #124

Open MestreLion opened 3 years ago

MestreLion commented 3 years ago

I'm using the 1.2a cmatrix on Ubuntu 18.04. I'm aware this is an old version, but upon inspecting both current git code and Debian and Ubuntu most recent packages I believe the scenario is the same:

matrix() {
    if ! [[ "$TERM" == "linux" ]]; then
        cmatrix -sbu8
        return
    fi
    local default=$(mktemp) && trap 'rm -f -- "$default"' RETURN
    setfont -O "$default" matrix.psf  # Backup current font, set matrix PSF font
    cmatrix -sblu8 2>/dev/null  # silence "Cannot find default font". Or just replace -l with -x
    setfont "$default"
}

Maybe the same strategy could be done by cmatrix itself?

MestreLion commented 3 years ago

Also, it would be great if cmake or its README could provide some instructions on how to use the X11 font mtx.pcf.gz on xterm or gnome-terminal. By default Ubuntu/Debian disables bitmaps fonts under X11, so it would be great to have the steps to enable its use.