Ubuntu 上 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 compton。若不使用 systemd,可在会话启动脚本(如 i3/config、Openbox autostart)中启动:compton --config ~/.config/compton.conf。二 基础配置模板与关键参数
backend = glx
vsync = false
shadow = false
fading = false
blur = false
mark-wmwin-focused = true
mark-ovredir-focused = true
use-damage = true
backend = glx
vsync = true
shadow = true
shadow-radius = 12
shadow-offset-x = -8
shadow-offset-y = -8
fading = true
fade-delta = 10
blur = true
blur-method = gaussian
blur-size = 6
blur-deviation = 2.0
mark-wmwin-focused = true
mark-ovredir-focused = true
use-damage = true
[opacity-rule]
90:class_g 'Firefox'
95:name 'Terminal'
三 性能优化要点
四 故障排查与替代方案