安裝Compton
打開終端,執行命令:
sudo apt update && sudo apt install compton
(部分新系統可能需安裝picom
,可嘗試sudo apt install picom
)
創建/編輯配置文件
配置文件路徑為~/.config/compton.conf
,若不存在則創建:
mkdir -p ~/.config/compton
compton --example-config > ~/.config/compton/compton.conf
或直接使用文本編輯器(如nano
)手動創建:
nano ~/.config/compton.conf
常用配置選項
在配置文件中可調整以下參數(示例):
backend = glx # 后端,可選xrender/glx(glx需顯卡支持OpenGL,性能更優)
vsync = true # 垂直同步
shadow = true # 窗口陰影
opacity = 0.8 # 窗口透明度(0.0-1.0)
ignore_root = true # 忽略根窗口透明度(避免部分桌面環境沖突)
啟動Compton
compton --config ~/.config/compton.conf -b
(-b
表示后臺運行)~/.xprofile
或桌面環境的“自動啟動程序”中。重啟生效
保存配置后,重啟Compton或系統:
pkill compton && compton --config ~/.config/compton.conf -b
注意:
/etc/gdm3/custom.conf
禁用Wayland。backend=glx
或限制CPU占用(如cpulimit -l 50 -p $(pgrep compton)
)。