启用 Debian 上 Compton 的硬件加速
一 准备与驱动检查
glxinfo | grep "OpenGL renderer" 应显示你的 GPU 型号而非 “llvmpipe/软件渲染”。glxgears -info 应达到明显 FPS(例如数百至数千),而不是极低值。sudo apt update && sudo apt install compton。二 配置 Compton 启用硬件加速
mkdir -p ~/.config && nano ~/.config/compton.conf。backend = "glx"
vsync = true
shadow = false
glx-no-stencil = false
glx-copy-from-front = true
glx-shape = true
glx-fbconfig = false
glx-hardware = true
glx-damage = true
damage = true
compton --config ~/.config/compton.conf -b(或先 killall compton 再启动)。三 开机自启动与常用管理方式
compton --config ~/.config/compton.conf -b 加入 ~/.xprofile 或 ~/.xinitrc。nano ~/.config/systemd/user/compton.service[Unit]
Description=Compton Window Composer
After=graphical-session.target
[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf -b
Restart=always
[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl --user enable --now compton.service
After=display-manager.service 且以正确的 User= 运行。四 验证与常见问题
glxinfo 显示真实 GPU 渲染器;glxgears 帧率正常。htop/top 观察 CPU 占用是否显著降低(合成工作转交 GPU)。shadow = false)可进一步减少 CPU 使用。compton --config ~/.config/compton.conf --dry-run 排错),并确认以正确的 用户/会话 启动服务。