你提到的 “Compton” 在 CentOS 上通常是指 Compton 合成器(窗口阴影/透明效果),常用于 i3 / Openbox 等轻量桌面环境。下面给你一份CentOS 上配置 Compton 的常见步骤(以 CentOS 7/8 为例,CentOS Stream 也基本通用)。
sudo yum install epel-release -y
# CentOS 8 / Stream
sudo dnf install epel-release -y
sudo yum install compton -y
# 或
sudo dnf install compton -y
⚠️ 注意:
- CentOS 8 之后部分版本仓库里叫
picom(Compton 的 fork)- 可尝试:
sudo dnf install picom
mkdir -p ~/.config/compton
vi ~/.config/compton/compton.conf
backend = "glx";
glx-no-stencil = true;
shadow = true;
shadow-radius = 8;
shadow-opacity = 0.6;
shadow-offset-x = -4;
shadow-offset-y = -4;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
vsync = "opengl-swc";
compton --config ~/.config/compton/compton.conf &
如果没报错,说明配置可用。
编辑 ~/.config/i3/config:
exec --no-startup-id compton --config ~/.config/compton/compton.conf
如果是 Openbox:
vi ~/.config/openbox/autostart
添加:
compton --config ~/.config/compton/compton.conf &
尝试修改 backend:
backend = "xrender";
建议:
backend = "glx";
glx-no-vsync = true;
现在更推荐:
sudo dnf install picom
配置文件路径相同,命令用 picom 替代 compton
如果你说的是 “Compton 在 CentOS 上做别的事”(比如某服务、某个软件叫 Compton),可以告诉我具体场景,我给你更针对性的步骤。