在 CentOS 上安装 compton(现在多称为 picom 的分支)后,主要通过配置文件 + 启动参数来调整外观和性能。下面按“从零到可用”给你一份实用指南。
which compton
compton --version
CentOS 默认仓库可能没有,常见安装方式:
# EPEL
sudo yum install -y epel-release
sudo yum install -y compton
# 或源码 / picom
git clone https://github.com/yshui/picom
cd picom && meson build && ninja -C build && sudo ninja -C build install
compton --config ~/.config/compton.conf
在 ~/.xinitrc 或桌面环境自启里加:
compton &
推荐路径:
~/.config/compton.conf
如果不存在,可新建:
mkdir -p ~/.config
touch ~/.config/compton.conf
backend = "glx";
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
shadow-offset-x = -5;
shadow-offset-y = -5;
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
shadow = false;
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g = 'Docky'"
];
vsync = true;
backend = "glx";
glx-swap-method = "buffer-age";
或尝试:
backend = "xrender";
opacity-rule = [
"85:class_g = 'URxvt'"
];
inactive-opacity = 0.9;
active-opacity = 1.0;
compton --config ~/.config/compton.conf -b -d
backend 不对 → 改 xrendershadow 和 blur| 桌面环境 | 建议 |
|---|---|
| GNOME | 不推荐(自带合成器) |
| KDE | 用自带,不叠 compton |
| XFCE | ✅ 非常适合 |
| i3 / Openbox | ✅ 必装 |
ps aux | grep compton
killall compton
compton --diagnostics
如果你愿意,可以告诉我:
我可以直接给你一份定制 config。