通过 Compton 配置提升系统响应速度
一 核心思路与适用场景
二 快速优化清单
三 示例配置与生效方式
backend = "glx";
vsync = true; # 若对延迟敏感,可改为 false 测试
shadow = false; # 关闭阴影
fade = false; # 关闭淡入淡出
# opacity-rule 与 shadow-exclude 可按需精简或移除
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 2;
shadow-offset-x = 2;
shadow-offset-y = 2;
shadow-opacity = 0.5;
fade = true;
fade-delta = 10;
shadow-exclude = [
"class_g 'GtkMenu'",
"class_g 'GtkDialog'",
"class_g 'Notification'"
];
pkill compton && compton --config ~/.config/compton.conf &
# 或
compton --config ~/.config/compton.conf --replace
mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/compton.service
写入:[Unit]
Description=Compton Compositor
After=graphical-session.target
[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf
Restart=always
[Install]
WantedBy=default.target
启用:systemctl --user daemon-reload
systemctl --user enable --now compton.service
四 故障排查与版本差异