安装Compton
sudo apt update && sudo apt install compton
(若系统默认使用picom,可安装picom替代)
编辑配置文件
配置文件路径:~/.config/compton.conf,若不存在则创建:
mkdir -p ~/.config/compton && touch ~/.config/compton.conf
nano ~/.config/compton.conf
关键优化参数
shadow = false # 禁用窗口阴影
opacity = false # 禁用窗口透明
fade = false # 禁用淡入淡出效果
backend = glx # 使用GLX后端(需显卡支持OpenGL)
vsync = true # 开启垂直同步(根据显示器调整,可尝试false)
delay = 10 # 降低阴影延迟(默认20ms,可减小至10ms)
cpulimit限制CPU使用率(需安装cpulimit):cpulimit -l 50 -p $(pgrep compton) # 限制CPU占用50%
重启Compton生效
killall compton && compton -c ~/.config/compton.conf &
(若使用picom,命令为picom -c ~/.config/compton.conf &)
验证优化效果
观察系统流畅度,若仍有卡顿可尝试进一步调整backend(如切换为xrender)或禁用更多特效。