Compton 在 CentOS 的配置秘诀
一 安装与运行
二 配置文件骨架与关键参数
# 渲染与同步
backend = "glx"
vsync = true
refresh-rate = 0
# 阴影
shadow = true
shadow-radius = 12
shadow-offset-x = -15
shadow-offset-y = -15
shadow-opacity = 0.30
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g = 'Polybar'",
"_GTK_FRAME_EXTENTS@:c"
]
# 淡入淡出
fade = true
fade-in-step = 0.03
fade-out-step = 0.03
fade-exclude = [ "name = 'Dock'" ]
# 透明度与忽略
opacity-rule = [
"90:class_g = 'URxvt'",
"0.85:class_g = 'Firefox'"
]
# 模糊(可选,性能开销较大)
# blur-background = true
# blur-kern = "3x3box"
# blur-radius = 3
# 窗口重定向(游戏/全屏优化)
unredirect-drawable = true
unredirect-skip-argb = true
# 日志(排错用)
# log-level = "warn"
# log-file = "/tmp/compton.log"
三 自启动与多显示器
[Unit]
Description=Compton compositor
After=graphical-session.target
[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf
Restart=on-failure
Environment=DISPLAY=:0
[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl --user enable --now compton.service
四 性能优化与常见问题