在 CentOS 上“开启 Compton”通常是指使用 compton 作为合成器(compositor)来实现窗口透明、阴影、动画等效果。下面按常见场景给你说明。
Compton 一般用于:
如果你用的是 GNOME,通常不需要 compton。
sudo yum install epel-release
sudo yum install compton
sudo dnf install epel-release
sudo dnf install compton
如果没有包(某些版本),可以源码编译:
sudo dnf install libconfig-devel dbus-devel mesa-libGL-devel
git clone https://github.com/chjj/compton
cd compton
make
sudo make install
compton &
如果能看到透明效果,说明成功了。
在 ~/.config/i3/config 里加:
exec --no-startup-id compton
~/.config/openbox/autostart~/.config/bspwm/bspwmrc加入:
compton &
创建:
mkdir -p ~/.config
nano ~/.config/compton.conf
示例:
backend = "glx";
glx-no-stencil = true;
shadow = true;
fade = true;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
然后启动:
compton --config ~/.config/compton.conf &
尝试:
compton --backend xrender
加参数:
compton --vsync opengl
Compton 已停更,建议使用:
sudo dnf install picom
picom &
如果你能告诉我:
我可以给你精确到命令的配置方案。