安装Compton
根据Linux发行版使用包管理器安装:
sudo apt install compton
sudo pacman -S compton
配置Compton
编辑配置文件(通常位于~/.config/compton.conf
),常用选项:
backend
:选择渲染后端(glx
为GPU加速,xrender
为CPU渲染)。shadow
:是否启用窗口阴影(true
/false
)。vsync
:是否开启垂直同步(true
/false
,减少画面撕裂)。opacity
:设置窗口透明度(0.0-1.0)。backend = "glx";
shadow = true;
vsync = true;
opacity = 0.9;
启动Compton
compton --config ~/.config/compton.conf
。优化与调整
ignore-glx-glitz = true
。killall compton
重启服务生效配置。注意:部分桌面环境(如GNOME)自带合成器,可能与Compton冲突,需禁用原生合成器。