启用与基本配置
backend = glx
vsync = true
shadow = true
保存后重启 Compton 生效。上述开关与后端是启用阴影的基础配置项。阴影参数调优
| 参数 | 含义 | 示例 |
|---|---|---|
| shadow-radius | 阴影模糊半径 | shadow-radius = 5 |
| shadow-offset-x | 水平偏移 | shadow-offset-x = 1 |
| shadow-offset-y | 垂直偏移 | shadow-offset-y = 1 |
| shadow-opacity | 阴影不透明度 | shadow-opacity = 0.3 |
[shadow]
shadow-radius = 5
shadow-offset-x = 1
shadow-offset-y = 1
shadow-opacity = 0.3
调整这些参数可改变阴影的“大小、距离、浓淡”,建议小步迭代以获得与桌面壁纸和主题匹配的观感。排除不需要阴影的窗口
shadow-exclude = [
"name 'Notification'",
"class_g ? 'Dmenu'",
"class_g ? 'Dunst'",
"_NET_WM_STATE@:32a * '_NET_WM_STATE_HIDDEN'",
"_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a * '_NET_WM_STATE_STICKY'",
"class_g ? 'i3-frame'"
]
以上规则覆盖了常见的无边框菜单、通知与隐藏/置顶状态窗口,可按桌面环境增删。应用与验证
ps -e | grep compton
killall compton
compton &
compton --config ~/.config/compton.conf -f
compton -b
以上步骤确保新配置被加载并常驻运行。常见问题与排查