在 CentOS 上配置并启动 Compton(现在多称为 picom 的分支/前身),通常用于为无独立合成器的窗口管理器(如 i3、Openbox、awesome)提供透明、阴影、模糊等特效。下面按步骤说明。
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
如果仓库没有
compton,可以考虑安装picom(新一代分支):
sudo dnf install picom
(以下配置对两者基本通用,文件名换成 picom.conf 即可)
Compton 默认读取:
~/.config/compton.conf
示例配置(常用、稳定):
# 透明
backend = "glx";
vsync = 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 '"
];
# 不透明窗口
no-dock-shadow = true;
clear-shadow = true;
# 排除
shadow-exclude = [
"name = ' Notification '",
"class_g = ' Conky '"
];
compton &
或(picom):
picom &
compton --config ~/.config/compton.conf &
在 ~/.i3/config 中添加:
exec --no-startup-id compton
在 ~/.config/openbox/autostart 中添加:
compton &
一般不建议,容易和桌面环境冲突。
vsync = false;
unredir-if-possible = true;
ps aux | grep compton
如果你用的是 CentOS + i3 / Openbox / 特定显卡(NVIDIA/Intel),可以告诉我,我给你更精确的配置。