Ubuntu 下用 Compton 解决画面撕裂的实用配置
一、先完成两项系统侧检查
xrandr -qxrandr --output eDP-1 --rate 60~/.xprofile 或窗口管理器启动脚本)。二、Compton 关键配置项与推荐值
xrandr --output <NAME> --rate <HZ> 后再启动 Compton。示例配置(保存为 ~/.config/compton.conf):
backend = "glx"
vsync = true
# vsync = "drm" # 如 true 有卡顿/延迟可尝试此项
glx-no-stencil = false
glx-copy-from-front = true
glx-shape = true
glx-fbconfig = false
glx-hardware = true
glx-damage = true
damage = true
shadow = false
# 如需模糊/透明度,可按需开启并精简规则
# opacity-rule = [ "90:class_g 'Firefox'", "90:class_g 'Terminal'" ]
三、应用与自启动
killall compton && compton -b~/.config/autostart/compton.desktop 中加入[Desktop Entry]
Type=Application
Exec=/usr/bin/compton -b --config ~/.config/compton.conf
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Compton
Comment=Compton Window Composer
~/.xprofile 或 ~/.xinitrc 中加入compton -b --config ~/.config/compton.conf。四、仍撕裂时的排查顺序
xrandr --output <NAME> --rate <HZ> 再启动 Compton。