CentOS 上 Compton 的常见问题与排查
一 安装与版本支持
sudo yum install comptonsudo dnf install comptoncompton &;若使用 systemd 管理,需自建服务单元(见下文)。二 配置与启动
compton --config ~/.config/compton.confps -e | grep compton[Unit]
Description=Compton Window Composer
After=xorg.service
[Service]
ExecStart=/usr/bin/compton --config /etc/xdg/compton.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload && sudo systemctl enable --now comptonbackend = glx(或 xrender,优先用 glx 获取更好性能)vsync = true(减少撕裂)shadow = trueopacity / alpha(窗口透明度)blur-background = true、blur-kern = "3x3box"(背景模糊)ignore_root = true(避免根窗口透明异常)三 常见故障与修复
journalctl -u compton.service,以及用户缓存日志 ~/.cache/compton/compton.log;必要时检查 /var/log/messages、dmesg。compton --config ~/.config/compton.conf。backend 改为 xrender、关闭 blur-background、shadow 等复杂特效,逐步排查。vsync = true,将 frame_rate 设为显示器刷新率或更低(如 30–60)。nvidia-smi;通用检查:lspci -k | grep -A2 -i "VGA")。ldconfig -p 检查动态库缓存,必要时重装相关库或 Compton。四 实用命令清单
sudo yum install compton;重装:sudo yum remove compton && sudo yum install comptonsudo dnf install compton;重装:sudo dnf remove compton && sudo dnf install comptoncompton &sudo systemctl start|stop|restart|enable|disable comptonps -e | grep comptonjournalctl -u compton.servicetail -n 50 ~/.cache/compton/compton.log