在 CentOS 里使用 compton(现在社区多叫 picom,compton 已停止维护)主要用来做窗口合成(透明、阴影、模糊等)。下面按 安装 → 配置 → 启动 → 自启 给你一套实用说明。
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
如果仓库没有,可改用 picom:
sudo dnf install picom
推荐放在用户目录:
~/.config/compton.conf
如果没有就新建:
mkdir -p ~/.config
touch ~/.config/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'"
];
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
unredir-if-possible = true;
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'"
];
compton --config ~/.config/compton.conf -b
-b 表示后台运行
ps aux | grep compton
compton --config ~/.config/compton.conf -b &
compton --config ~/.config/compton.conf
在 ~/.config/i3/config:
exec --no-startup-id compton --config ~/.config/compton.conf
backend = "glx" 或 xrenderbackend = "xrender";
vsync = false;
glx-swap-method = "exchange";
| 项目 | compton | picom |
|---|---|---|
| 维护状态 | ❌ 停更 | ✅ 活跃 |
| 模糊支持 | 弱 | 强 |
| 推荐 | 老系统 | 新系统 |
picom 配置基本兼容 compton。
如果你告诉我:
我可以给你 针对性配置。