安裝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沖突,需禁用原生合成器。