在 CentOS 上使用 compton(一个轻量级 X11 合成管理器,常用于 i3 / Openbox 等窗口管理器实现透明和阴影效果),一般步骤如下:
sudo yum install -y epel-release
sudo yum install -y compton
某些 CentOS 版本仓库中是
compton,新版本可能叫picom(compton 的分支):
sudo yum install -y picom
compton &
或(picom):
picom &
创建配置文件:
mkdir -p ~/.config/compton
vi ~/.config/compton/compton.conf
示例配置(常用):
backend = "glx";
shadow = true;
shadow-radius = 10;
shadow-opacity = 0.5;
shadow-offset-x = -5;
shadow-offset-y = -5;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
vsync = true;
启动:
compton --config ~/.config/compton/compton.conf &
在 ~/.config/i3/config 中加入:
exec --no-startup-id compton
在 ~/.config/openbox/autostart 中:
compton &
compton --backend xrender
建议:
backend = "xrender";
vsync = "none";
使用 picom 或自己编译:
sudo dnf install picom
查看日志:
compton --config ~/.config/compton/compton.conf -b -l 2
如果你能告诉我:
我可以给你更精确的配置。