Ubuntu 中调整 Compton 的完整指南
一 安装与检查运行状态
sudo apt update && sudo apt install comptonps -e | grep comptoncomptoncompton --daemon 或 compton -b二 配置文件位置与启用方式
compton --config ~/.config/compton.conf -bcompton -b 加入 ~/.xprofile 或 ~/.xinitrc(登录会话启动时执行)。nano ~/.config/systemd/user/compton.service[Unit]
Description=Compton Compositor
After=graphical-session.target
[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf -b
Restart=on-failure
[Install]
WantedBy=default.target
systemctl --user daemon-reload && systemctl --user enable --now compton三 常用参数与推荐起点
cp ~/.config/compton.conf ~/.config/compton.conf.bakbackend = "glx"
vsync = "true"
shadow = true
shadow-exponent = 3.0
shadow-color = "#00000080"
opacity = 0.95
frame-rate = 60
dpr = 1
background-opacity = 1.0
ignore-root = true
glx(性能与兼容性更好),如遇问题再试 xrender。true 减少撕裂,false 可能降低输入延迟(看显示器与驱动)。四 应用更改与故障排查
killall compton && compton -bsystemctl --user restart compton(或 sudo systemctl restart compton 系统级)compton(便于定位启动失败原因)compton --log-level debugcompton --shadow-disablecompton -fshadow = false、减少透明层)。glx 后端,必要时回退 xrender。