Compton 是 Linux 下常用的 compositor(窗口合成器,常用于 i3、Openbox 等轻量桌面),常见问题是:黑屏、闪烁、透明失效、CPU 占用高、启动报错、与显卡/驱动冲突等。下面按「排查 → 修复 → 常见场景」给你一套实用方案。
which compton
compton --version
没装:
# Debian/Ubuntu
sudo apt install compton
# Arch
sudo pacman -S compton
注:新项目已改名为 picom,建议新系统直接用
picom
pkill compton
compton --config ~/.config/compton.conf
或后台运行:
compton -b
新建 ~/.config/compton.conf:
backend = "glx";
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "none";
shadow = false;
fade = false;
然后:
pkill compton
compton -b --config ~/.config/compton.conf
如果这样正常 → 原配置有问题
原因:backend 不匹配
修复:
backend = "xrender";
或:
backend = "glx";
NVIDIA 用户常用:
backend = "glx";
glx-no-stencil = true;
开启 vsync:
vsync = true;
或:
vsync = "opengl-swc";
Intel / AMD:
vsync = "opengl";
确保:
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
并检查窗口管理器是否支持 ARGB
关闭特效:
shadow = false;
fade = false;
unredir-if-possible = true;
xinerama-screens = 1;
或:
detect-monitors = true;
✅ 正常可用
❌ 不建议用 compton(自带 compositor)
关闭系统合成:
Alt+F2 → rcompton --log-level trace
或:
compton -b --log-file /tmp/compton.log
看报错关键词:
GLX → 显卡/驱动X error → 配置错误backend → backend 不支持sudo apt install picom
picom -b
配置文件:
~/.config/picom/picom.conf
你可以直接贴:
我可以给你一份精准可用的配置。