linux终端屏保cmatrix
Cmatrix是一款充满乐趣的Linux和 Unix系统命令行程序。它可以模仿经典电影《黑客帝国Matrix》系列中的场景,用绿色的字符流营造出雨一般的下落效果
env
- centos7.9
- Cmatrix-v2.0
cmatrix
steps
1.1apt/yum
apt install -y cmatrix
dnf install -y cmatrix
1.2src-building
1.check ncurses
Run this command to check the version of ncurses.
ldconfig -p | grep ncurses
..
[root@c7-100 ~]# ldconfig -p |grep ncurses
libncursesw.so.5 (libc6,x86-64) => /lib64/libncursesw.so.5
libncurses.so.5 (libc6,x86-64) => /lib64/libncurses.so.5
libncurses++w.so.5 (libc6,x86-64) => /lib64/libncurses++w.so.5
libncurses++.so.5 (libc6,x86-64) => /lib64/libncurses++.so.5
[root@c7-100 ~]#
If you get no output then you need to install ncurses. Click below to install ncurses in Linux.
ncurses
yum install -y ncurses-devel //编译依赖
2.untar
cd `mktemp -d`
tar zxf cmatrix-2.0.tar.gz
cd cmatrix-2.0
3.buiding
//use configure make
autoreconf -i # skip if using released tarball //yum install -y autoconf automake
./configure
make
make install
//use cmake (or)
mkdir -p build
cd build
# to install to "/usr/local"
cmake ..
# OR
# to install to "/usr"
#cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
make install
cmatrix help
[root@c7-100 ~]# cmatrix -h
Usage: cmatrix -[abBcfhlsmVx] [-u delay] [-C color]
-a: Asynchronous scroll
-b: Bold characters on
-B: All bold characters (overrides -b)
-c: Use Japanese characters as seen in the original matrix. Requires appropriate fonts
-f: Force the linux $TERM type to be on
-l: Linux mode (uses matrix console font)
-L: Lock mode (can be closed from another terminal)
-o: Use old-style scrolling
-h: Print usage and exit
-n: No bold characters (overrides -b and -B, default)
-s: "Screensaver" mode, exits on first keystroke
-x: X window mode, use if your xterm is using mtx.pcf
-V: Print version information and exit
-u delay (0 - 10, default 4): Screen update delay
-C [color]: Use this color for matrix (default green)
-r: rainbow mode
-m: lambda mode
//example
cmatrix -ba -u 2 -C red
cmatrix -lba
cmatrix -ol
#常用参数
-h:打印命令的用法
-a:异步滚动
-b:开启粗体效果
-B:所有字符使用粗体
-n:关闭字符粗体(覆盖-b和-B的效果)
-V:打印版本信息
-C [color]:使用指定颜色(默认绿色)
-r:彩虹模式
-u [delay]:指定屏幕刷新延迟时长(0 - 10,默认 4)
#运行时按键命令
按键 作用
1-9 屏幕刷新延迟时间
a 一步滚动
b 开启粗体效果
B 所有字符粗体
n 关闭粗体
q 退出
! 字体颜色切换为红色
@ 字体颜色切换为绿色
# 字体颜色切换为黄色
$ 字体颜色切换为蓝色
% 字体颜色切换为洋红色
^ 字体颜色切换为青色
& 字体颜色切换为白色