在 CentOS 上,Compton(现在多称为 picom)的配置文件位置和常见配置方式如下:
~/.config/compton.conf
或(新版 picom):
~/.config/picom.conf
如果不存在,可以手动创建:
mkdir -p ~/.config
touch ~/.config/compton.conf
/etc/compton.conf
或
/etc/xdg/compton.conf
启动方式决定读取哪个配置:
compton --config ~/.config/compton.conf
如果不指定 --config,默认读取:
~/.config/compton.conf/etc/xdg/compton.conf# 开启阴影
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
# 透明
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
# 后台运行
daemon = true;
# 使用 GLX 后端(性能更好)
backend = "glx";
vsync = true;
yum install -y epel-release
yum install -y compton
dnf install -y compton
或(更推荐 picom):
dnf install -y picom
在 ~/.xinitrc 或窗口管理器启动脚本中加入:
compton &
或
picom &
ps aux | grep compton
如果你用的是 GNOME / KDE / i3 / Openbox,我可以给你对应环境的配置示例。