在 CentOS 上配置 Compton(现在更多叫 picom)通常用于给窗口管理器(如 i3、Openbox、awesome 等)提供透明、阴影、模糊等合成效果。下面按常见场景给你一个清晰配置指南。
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
如果仓库里没有,可以用
picom(Compton 的 fork):
sudo dnf install picom
如果你是 i3 / Openbox / awesome 用户,在配置文件中加入:
compton &
或
picom &
手动测试:
compton --config ~/.config/compton.conf
配置文件路径:
~/.config/compton.conf
backend = "glx";
glx-no-stencil = true;
shadow = true;
shadow-radius = 12;
shadow-offset-x = -2;
shadow-offset-y = -2;
shadow-opacity = 0.5;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
vsync = true;
opacity-rule = [
"80:class_g = 'Terminal'",
"100:class_g = 'Firefox'"
];
shadow = true;
shadow-radius = 10;
shadow-opacity = 0.45;
blur-method = "gaussian";
blur-strength = 10;
shadow-exclude = [
"name = 'Notification'"
];
在 ~/.config/i3/config:
exec --no-startup-id compton
在 ~/.config/openbox/autostart:
compton &
尝试:
backend = "xrender";
或关闭 vsync:
vsync = false;
确认:
如果你是新装系统,建议直接用 picom:
sudo dnf install picom
picom --experimental-backends
如果你能告诉我:
我可以直接给你一份可用配置。