Ubuntu下Compton性能优化技巧
一 基础准备与配置路径
sudo apt-get install compton;ps -e | grep compton。配置文件通常位于 ~/.config/compton.conf 或 /etc/xdg/compton.conf。修改后可通过 killall compton && compton & 使配置生效。二 关键参数优化清单
backend = "glx"
vsync = true
shadow = false
opacity = 1.0
ignore_root = true
frame-rate = 60
以上选项在多数 NVIDIA/AMD/Intel 桌面环境中能显著提升流畅度与降低 CPU/GPU 占用。三 进阶优化与场景化调优
shadow-exclude = [ "class_g = 'Firefox'" ]
opacity-rule = [ "90:class_g = 'Alacritty'", "100:class_g = 'Thunar'" ]
cpulimit -l 50 -p $(pgrep compton)(将 Compton 的 CPU 占用限制在 50%)。四 快速排查与替代方案
top/htop 观察 CPU/GPU 占用变化;4) 修改后务必重启 Compton 生效。