CentOS 下 Compton 配置与显示优化指南
一 安装与准备
二 配置文件骨架与关键参数
# 渲染与同步
backend = glx
vsync = true
# 特效开关(先关闭以测性能)
shadow = false
blur-background = false
opacity = 1.0
# 基础显示
refresh-rate = 0
detect-rounded-corners = true
detect-client-leader = true
mark-visible-windows = true
# 阴影参数(仅在 shadow = true 时生效)
# shadow-radius = 12
# shadow-offset-x = 1
# shadow-offset-y = 1
# shadow-opacity = 0.30
# 模糊参数(仅在 blur-background = true 时生效)
# blur-method = gaussian
# blur-size = 6
# blur-deviation = 2.0
# 窗口规则(按需精简)
[opacity-rule]
90:class_g = 'Firefox'
95:class_g = 'Terminal'
三 性能与显示优化要点
四 启动与自启动
[Unit]
Description=Compton Window Composer
After=graphical-session.target
[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf --log-level 0
Restart=on-failure
Environment=DISPLAY=:0
[Install]
WantedBy=graphical-session.target
[Unit]
Description=Compton Window Composer
After=display-manager.service
[Service]
ExecStart=/usr/bin/compton --config /home/你的用户名/.config/compton.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
五 场景化配置建议