Ubuntu中配置Compton的步骤如下:
安装Compton:
sudo apt-get install compton
创建/编辑配置文件:
配置文件路径为~/.config/compton.conf
(若不存在则手动创建),使用文本编辑器(如nano
)打开:
nano ~/.config/compton.conf
常用配置选项:
backend = glx
(性能更优,可能兼容性略差)或backend = xrender
。shadow = true/false
、opacity = 0.8
(0.0-1.0,0.0完全透明)。vsync = true/false
,减少屏幕撕裂。ignore_root = true
,解决部分桌面环境兼容性问题。重启Compton生效:
killall compton
compton &
或通过systemctl
(部分系统):
sudo systemctl restart compton
注意:若使用Wayland桌面环境,需确保Compton与Wayland兼容(部分旧版本可能存在问题,可尝试切换至X11或更新软件版本)。