Ubuntu 下 cmatrix 自定义主题指南
一 快速配色方案
cmatrix -C cyan。二 使用配置文件进行主题化
colors=8;5;146 指定绿色系)。colors=8;5;146
font=Terminus:pixelsize=14
speed=50
cmatrix 即可生效;若某项不生效,请参考下一节的源码主题方式。三 进阶 源码级主题定制(添加自定义主题)
sudo apt update
sudo apt install build-essential libncurses5-dev libncursesw5-dev autoconf automake
git clone https://github.com/abishekvashok/cmatrix.git
cd cmatrix
autoreconf -i
./configure
// 在源码中找到颜色表定义处,新增主题(示例:Ocean)
static const char *my_ocean_theme[] = {
"\033[38;5;24m", // 深蓝
"\033[38;5;45m", // 青蓝
"\033[38;5;51m", // 青绿
"\033[38;5;87m", // 天蓝
"\033[38;5;123m", // 浅青
"\033[38;5;159m", // 亮青
"\033[38;5;195m", // 淡青白
"\033[0m" // 重置
};
// 在主题枚举/名称映射中新增 "ocean" 并在初始化处绑定到 my_ocean_theme
make
sudo make install
cmatrix -T ocean
四 常见问题与排查
./configure && make。