在 CentOS 上配置 compton(现多称为 picom 的前身)主要用于实现窗口合成的透明、阴影、模糊等效果。下面按步骤说明。
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
如果仓库中没有,可从源码编译:
sudo dnf install git make gcc libconfig-devel dbus-devel pcre-devel xcb-devel
git clone https://github.com/chjj/compton
cd compton
make
sudo make install
mkdir -p ~/.config/compton
nano ~/.config/compton/compton.conf
backend = "glx";
glx-no-stencil = true;
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
shadow-offset-x = -5;
shadow-offset-y = -5;
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
unredir-if-possible = true;
vsync = "opengl-swc";
compton --config ~/.config/compton/compton.conf -b
名称:compton
命令:compton --config ~/.config/compton/compton.conf -b
gnome-session-properties
添加同上命令。
尝试:
backend = "xrender";
vsync = false;
可用 picom 替代:
sudo dnf install picom
配置方式基本一致。
ps aux | grep compton
如果你用的是 具体桌面环境(GNOME/XFCE/i3) 或 CentOS 版本,我可以给你更精确的配置。