在 CentOS 上用 Compton(现在更多叫 picom,Compton 已停止维护)做窗口特效,基本思路是:安装 → 写配置文件 → 启动。下面按“新手可操作”的方式说明。
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
或更推荐:
sudo dnf install picom
建议直接用
picom,功能更全。
新建配置文件:
mkdir -p ~/.config/compton
nano ~/.config/compton/compton.conf
# 开启阴影
shadow = true;
shadow-radius = 12;
shadow-offset-x = -5;
shadow-offset-y = -5;
shadow-opacity = 0.5;
# 窗口透明度
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
# 动画(淡入淡出)
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
# 渲染优化
backend = "glx";
vsync = true;
# 忽略全屏
unredir-if-possible = true;
compton --config ~/.config/compton/compton.conf &
或
picom --config ~/.config/compton/compton.conf &
在 ~/.xinitrc 或桌面环境自启里加:
compton --config ~/.config/compton/compton.conf &
| 特效 | 配置项 |
|---|---|
| 窗口阴影 | shadow = true |
| 圆角窗口 | rounded-corners = true(picom 新版本) |
| 模糊背景 | blur-method = "gaussian"; blur-strength = 10; |
| 透明终端 | opacity-rule |
| 动画 | fading = true |
backend = "xrender";
vsync = false;
unredir-if-possible = true;
如果你告诉我:
我可以直接给你一套可用配置。