CentOS 上 Compton 配置故障排除指南
一 快速定位流程
ps -e | grep compton,若无输出说明未运行。compton --config ~/.config/compton/compton.conf -b(前台运行便于直接看到报错)。journalctl -xe | grep compton 获取启动失败原因。compton --config /path/to/compton.conf 验证配置文件语法与可用性。二 配置文件与语法排查
backend = "glx";shadow = true;fade = true;unredir-if-possible = true;compton --config <配置路径> 校验,再前台运行观察输出。三 常见症状与修复建议
backend = "xrender";若显卡驱动或 OpenGL 有问题,glx 后端可能异常。vsync = true;),并适当设置 fps 上限(如 fps = 60;)。shadow-exclude 精确排除,例如:shadow-exclude = "*.menu,*.notification";。四 以 Systemd 管理时的要点
[Unit]
Description=Compositor for X11
After=display-manager.service
[Service]
ExecStart=/usr/bin/compton -c /home/your-username/.config/compton/compton.conf
Restart=always
User=your-username
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload、sudo systemctl enable --now compton.servicesystemctl status compton.service、journalctl -xe | grep compton五 仍未解决时的建议信息
lspci -nn | grep -iE "vga|3d|display" 与 glxinfo | grep "OpenGL renderer"compton --versioncompton -c ... -b)及终端报错全文~/.config/compton/compton.conf 内容