自定義Compton的配置文件可以通過以下步驟完成:
~/.config/compton.conf
。如果該文件不存在,你可以手動創建一個。mkdir -p ~/.config
touch ~/.config/compton.conf
nano
、vim
或gedit
)打開并編輯配置文件。以下是一些常用的配置選項及其說明:
glx
或x11
。backend = "glx"
vsync = true
shadow = true
opacity = 0.9
blur-radius = 4
shadow-exclude = [ "class_g = 'Firefox'" , "class_g = 'Thunderbird'" ]
保存并關閉配置文件后,重新啟動Compton以應用更改。在Debian和Ubuntu系統中,可以使用以下命令重啟Compton:
sudo systemctl restart compton
在Fedora和RHEL系統中,可以使用以下命令重啟Compton:
sudo systemctl restart compton.service
如果你希望使用非默認的配置文件路徑,可以在運行Compton時通過--config
參數指定路徑:
compton --config /path/to/your/custom-compton.conf -f
backend
設置為glx
或wayland
(而非xrender
)。backend glx
以啟用GPU加速。systemd
或cpulimit
等工具限制Compton的資源占用,例如將CPU使用率限制在50%。