安装Compton
更新系统后安装:
sudo apt update && sudo apt install compton
配置视觉效果
编辑配置文件 ~/.config/compton.conf,常用参数:
shadow = true,调整 shadow-radius、shadow-opacity 等参数。bg_blur = true,设置 blur-kern(如 "3x3box")控制模糊程度。opacity = 0.8(窗口透明度),inactive-opacity = 0.7(非活动窗口透明度)。vsync = true 减少画面撕裂。glx-no-stencil = true、unredir-if-possible = true 提升流畅度。启用特效
corner-radius = 10(需配合 rounded-corners-exclude 排除特定窗口)。fading = true,调整 fade-delta 和 fade-in-step/fade-out-step 控制速度。启动与自动运行
手动启动:
compton --config ~/.config/compton.conf
自动启动:创建 systemd 服务文件 /etc/systemd/system/compton.service,内容参考,然后执行:
sudo systemctl enable compton && sudo systemctl start compton
调试与优化
backend = xrender(牺牲特效换性能)。shadow-exclude 或 opacity-exclude 中添加窗口规则(如 "class_g = 'Conky'")。根据硬件配置调整参数,平衡视觉效果与性能。