在 CentOS 上排查 Compton(或已演进为 picom) 的问题,可以按下面系统化的思路来定位。Compton 常见问题是:启动失败、黑屏/闪屏、透明无效、CPU 占用高、与桌面环境冲突。
echo $DISPLAY
:0loginctl show-session $(loginctl | awk '/seat/ {print $1}') -p Type
wayland → Compton 无法工作,需切回 X11 或改用其它合成器glxinfo | head
(没有就装:yum install mesa-demos)
ps aux | grep compton
或
pgrep -a compton
没运行但你认为启动了 → 看日志。
不要后台运行,直接终端执行:
compton --config ~/.config/compton.conf
或(无配置):
compton -b
观察终端输出,常见错误:
Failed to load backendAnother composite manager is runningNo screen found常见于:
解决:
Compton 对配置很敏感。
检查:
compton --config ~/.config/compton.conf --show-uncalled
常见错误:
shadow-exclude 格式)最简可用配置示例:
backend = "glx";
glx-no-stencil = true;
vsync = "opengl-swc";
shadow = true;
fade = true;
尝试:
compton --backend xrender
或
compton --no-fading-openclose
确认:
opacity-rule 覆盖测试:
compton --opacity-rule "90:class_g = 'URxvt'"
降低负载:
vsync = false;
unredir-if-possible = true;
compton --log-level trace
journalctl -xe | grep compton
CentOS 默认仓库可能:
可选:
yum install compton
# 或
yum install picom
yum install epel-release
$DISPLAY 是否存在如果你愿意,可以把 具体现象 + 报错信息 + 桌面环境 发出来(例如:CentOS 7 + XFCE + 黑屏),我可以直接帮你定位到配置项。