Compton 与 Xorg 的集成方法
一 核心概念与兼容性
二 安装与准备
sudo apt update && sudo apt install comptonsudo yum install compton xorg-x11-server-Xorg xorg-x11-server-X11-commonmkdir -p ~/.config && nano ~/.config/compton.conf,后续将示例配置写入该文件。三 配置要点与示例
# 基本渲染与修复
backend = "glx"
vsync = true
glx-no-stencil = true
glx-copy-from-front = false
# 阴影
shadow = true
shadow-radius = 12
shadow-offset-x = -12
shadow-offset-y = -12
shadow-opacity = 0.30
shadow-exclude = [
"class_g = 'GtkWindow'",
"class_g = 'GtkDialog'"
]
# 不透明度(可按需开启)
# opacity-rule = [ "90:class_g='Gnome-terminal'" ]
# 背景与模糊(可选)
# background = "#000000"
# blur-background = true
# blur-background-frame = true
# blur-kern = "3x3box"
四 启动与自启动方式
compton --config ~/.config/compton.conf --log-compositor 2> ~/.compton.logcompton --config ~/.config/compton.confpgrep -x compton 或查看日志 tail ~/.compton.log五 常见问题与排查
WaylandEnable=false),改用 Xorg 登录后再启动 Compton。glxinfo | grep "OpenGL renderer" 确认硬件加速生效。