在 Linux 下 compton(现为 picom)配置失败 的原因很多,下面按常见原因 → 排查方法 → 解决示例来说明,你可以对照自己的情况。
compton 默认读取:
~/.config/compton.conf
或旧版本:
~/.compton.conf
❌ 错误示例:
~/.config/compton/compton.conf # 错
✅ 正确:
~/.config/compton.conf
compton 使用 INI 风格,不是 YAML / JSON。
❌ 错误:
shadow: true
blur:
method = gaussian
✅ 正确:
shadow = true
blur-method = gaussian
很多发行版已弃用 compton:
compton → picom
检查:
which compton
which picom
✅ 建议直接使用:
picom --config ~/.config/compton.conf
compton 需要:
检查:
echo $XDG_SESSION_TYPE
如果是 wayland,compton 不工作
例如:
冲突会导致“看起来没生效”。
解决:
pkill compton
pkill picom
pkill xcompmgr
compton --config ~/.config/compton.conf -f
或
picom -b --config ~/.config/compton.conf --log-level info
常见错误:
Invalid optionParse errorBackend not supportedbackend = "glx"
vsync = true
shadow = true
shadow-radius = 12
shadow-opacity = 0.4
fade = true
fade-in-step = 0.03
fade-out-step = 0.03
启动:
picom --config ~/.config/compton.conf &
你可以直接贴出:
我可以一行一行帮你改 ✅