在 Linux 下调试 compton(或 picom) 的错误,通常可以按下面几个步骤来:
不要直接靠桌面环境自动启动,先关掉已有的 compton,然后手动运行:
compton --config ~/.config/compton.conf
或(新版本叫 picom):
picom --config ~/.config/picom.conf
如果已经运行了:
killall compton
# 或
killall picom
加上调试参数看详细日志:
compton -b --log-level trace --log-file /tmp/compton.log
或:
picom --log-level trace --log-file /tmp/compton.log
然后查看日志:
cat /tmp/compton.log
常用日志级别:
errorwarninfodebugtrace(最详细)错误示例:
Error parsing configuration file
解决:
compton --config ~/.config/compton.conf --dump
或
picom --config ~/.config/picom.conf --dump
错误示例:
Backend 'glx' failed
解决:
compton --backend xrender
或
picom --backend xrender
glxinfo | grep "OpenGL"
现象:透明无效或闪屏
解决:
ps aux | grep compton
killall compton
compton --backend glx --vsync opengl-swc
如果不确定哪里出错,用最小配置:
backend = "xrender";
shadow = false;
fade = false;
然后逐步加功能。
# 查看是否运行
ps aux | grep compton
# 强制重新加载
killall -SIGUSR1 compton
# 检查 X 扩展
xdpyinfo | grep -i composite
如果你愿意,可以把:
发出来,我可以帮你精确定位问题。