你指的 Compton 一般是指 Linux 下的 X11 复合管理器(compositor),用来做窗口透明、阴影、模糊、动画等效果(现在很多时候已被 picom 取代,picom 是 compton 的活跃分支)。
下面按常见使用方式给你一套配置说明。
sudo apt install compton
# 或推荐
sudo apt install picom
sudo pacman -S picom
sudo dnf install picom
配置文件一般放在:
~/.config/compton.conf
# 或
~/.config/picom.conf
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
shadow-offset-x = -4;
shadow-offset-y = -4;
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
unredir-if-possible = true;
compton --config ~/.config/compton.conf &
# 或
picom --config ~/.config/picom.conf &
在 .xinitrc 或窗口管理器启动脚本里加:
picom &
exec dwm
systemctl --user enable picom
systemctl --user start picom
opacity-rule = [
"80:class_g = 'Alacritty'",
"70:class_g = 'Termite'"
];
blur:
{
method = "gaussian";
size = 10;
deviation = 5.0;
}
unredir-if-possible = true;
shadow-exclude = [
"class_g = 'Conky'",
"name = 'Notification'"
];
ps aux | grep picom
backend = "xrender";
Compton / Picom 只支持 X11 Wayland 请用:
如果你是新用户,强烈建议用 picom 而不是 compton,因为:
如果你告诉我:
我可以给你一份完全定制好的配置。