在 Linux 上排查 compton(或新版 picom) 的报错,一般可以按下面步骤来。
很多发行版已用 picom 替代 compton:
which compton
which picom
picom → 用 picomcompton → 老版本下面以 compton / picom 通用 说明。
不要直接后台启动,先前台看日志:
compton --config ~/.config/compton.conf
# 或
picom --config ~/.config/picom.conf
常见错误会直接打印在终端,例如:
compton --debug
# 或
picom --debug
或写配置:
debug = true;
日志会显示:
常见错误来源:
~/.config/compton.conf~/.config/picom.conf测试配置是否合法:
compton --config ~/.config/compton.conf --dry-run
backend = "glx"; # 驱动不支持会崩
vsync = true;
可先改为:
backend = "xrender";
compton 不支持 Wayland:
echo $XDG_SESSION_TYPE
wayland → compton 无法使用x11 → 正常glxinfo | grep "OpenGL renderer"
nvidia-drivermesa 正常GLX 后端失败时常报:
Failed to initialize GLX
backend = "xrender";
unredir-if-possible = false;
opacity-rule = [
"90:class_g = '.*'"
];
看是否已有 compositor:
ps aux | grep compton
compton 本身不写日志文件,但你可以重定向:
compton --debug > ~/compton.log 2>&1
backend = "xrender";
vsync = false;
shadow = false;
fade = false;
逐步加功能,定位问题。
如果你愿意,可以把:
发出来,我可以直接帮你定位。