温馨提示×

debian compton怎样调试错误

小樊
53
2026-10-19 13:16:41
栏目: 智能运维

在 Debian 上调试 compton(或已更名为 picom) 的报错,一般可以按下面步骤来做。


一、确认你用的是 compton 还是 picom

Debian 新版里 compton 基本已被 picom 取代:

which compton
which picom

如果有 picom,建议直接用 picom。


二、前台运行并查看日志(最重要)

不要后台运行,直接终端启动:

compton --config ~/.config/compton.conf
# 或
picom --config ~/.config/picom.conf

常见调试参数:

picom -b        # 后台(调试时不建议)
picom --show-all-errors
picom --log-level trace
picom --log-file /tmp/picom.log

观察终端输出,一般错误会直接显示,比如:

  • 配置文件语法错误
  • backend 不支持(glx / xrender)
  • 与窗口管理器冲突

三、常见错误与解决办法

1. 配置文件错误

compton / picom 对配置很敏感。

检查配置语法:

picom --config ~/.config/picom.conf --show-all-errors

建议:

  • 先用最小配置测试
  • 注释掉大部分选项

最小示例(~/.config/picom.conf):

backend = "glx";
vsync = true;

2. GLX / OpenGL 报错

常见于:

  • 虚拟机
  • NVIDIA 闭源驱动
  • 老显卡

尝试:

backend = "xrender";

或:

picom --backend xrender

3. 与窗口管理器冲突

如果你在用:

  • GNOME(自带合成器)
  • KDE
  • Mutter / Muffin

要先关闭系统合成器,否则 compton 无法工作。

例如 GNOME:

gsettings set org.gnome.mutter experimental-features "[]"

4. 权限 / X11 问题

确保你在 X11 会话,而不是 Wayland:

echo $XDG_SESSION_TYPE

如果是 wayland,compton 不支持,需切换到 X11。


四、调试核心转储 / 崩溃

如果直接闪退:

picom --log-level debug

或:

gdb --args picom --config ~/.config/picom.conf

五、推荐排查顺序

  1. 终端前台运行
  2. 看报错信息
  3. 用最小配置
  4. 换 backend(glx → xrender)
  5. 确认不是 Wayland
  6. 确认没有其他合成器

如果你愿意,可以把 具体报错信息 或 你的 compton.conf 发出来,我可以直接帮你定位问题。

0 踩