你提到的 Compton 通常是一个在 Linux 上提供窗口透明、阴影、特效的 X11 合成器(compositor)。在 CentOS 上启动 Compton,一般步骤如下(假设你用的是 CentOS 7/8 且使用 X11 桌面,如 GNOME/MATE/XFCE):
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
如果找不到包,也可以从源码编译(不推荐新手)。
compton
或(后台运行):
compton &
如果你看到透明和阴影生效,说明成功了。
创建配置文件:
mkdir -p ~/.config
nano ~/.config/compton.conf
示例配置(常用):
backend = "glx";
shadow = true;
fade = true;
opacity-rule = [
"90:class_g = 'URxvt'"
];
然后启动:
compton --config ~/.config/compton.conf &
mkdir -p ~/.config/autostart
创建文件:
nano ~/.config/autostart/compton.desktop
内容:
[Desktop Entry]
Type=Application
Exec=compton --config ~/.config/compton.conf
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Compton
Compton 不支持 Wayland,必须切回 X11:
登录界面 → 齿轮 → 选择 GNOME on Xorg
compton --diagnostics 查看错误sudo dnf install picom
picom &
如果你能告诉我:
我可以给你更精确的启动方案。