在 Linux 下使用 Compton(或其继任者 Picom) 做窗口合成器时,以下几步/配置最关键,直接影响显示效果、性能和稳定性。
backend = "glx";
# 或
backend = "xrender";
✅ 重要原因:后端选错会导致:
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
shadow-offset-x = -2;
shadow-offset-y = -2;
⚠️ 常见坑:
shadow-exclude = [
"class_g = 'Firefox'",
"name = 'Notification'"
];
unredir-if-possible = true;
或 Picom 中:
unredirect-fullscreen = true;
✅ 作用:全屏时绕过合成,提升游戏/视频性能
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
适合动画党,但:
fade = falseblur-method = "gaussian";
blur-strength = 10;
⚠️ 只在需要毛玻璃效果时开
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
否则会出现:
exec --no-startup-id compton &
或
picom &
ps aux | grep compton
backend = "glx";
shadow = true;
unredir-if-possible = true;
fade = false;
最重要三步:
如果你用的是 i3 / dwm / bspwm / KDE,我可以给你一份针对性配置。