你提到的 “Compton” 通常是指在 Linux 桌面环境下用于实现窗口透明、阴影、合成特效的轻量级合成器(现在更多被 picom 取代,但配置方式基本相同)。下面以 CentOS(以 CentOS 7 / 8 为例,桌面环境如 GNOME、XFCE、MATE)来说明 Compton 的安装与配置方法。
sudo yum install -y epel-release
sudo yum install -y compton
CentOS 8 可使用:
sudo dnf install -y compton
(若仓库中没有,可考虑使用 picom,命令类似)
配置文件一般放在:
~/.config/compton.conf
示例配置(常用):
# 透明设置
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
# 阴影
shadow = true;
shadow-radius = 12;
shadow-offset-x = -3;
shadow-offset-y = -3;
shadow-opacity = 0.4;
# 合成模式
backend = "glx";
vsync = true;
# 避免全屏卡顿
unredir-if-possible = true;
# 背景模糊(可选)
blur-background = true;
blur-background-frame = true;
compton --config ~/.config/compton.conf &
compton --config ~/.config/compton.confGNOME 默认使用 Mutter,Compton 可能冲突,建议:
picomcompton --backend glx --vsync opengl
尝试:
vsync = false;
可编译安装:
git clone https://github.com/chjj/compton
cd compton
make
sudo make install
安装 picom(推荐):
sudo yum install picom
如果你能说明:
我可以给你更精确的一套配置。