在 Debian 上配置 Compton(现在社区更多用它的继任者 picom,但 Debian 里包名仍常叫 compton)一般用于实现窗口透明、阴影、淡入淡出等合成效果。下面给你一套从安装到常用配置的步骤。
sudo apt update
sudo apt install compton
或者安装更活跃的 fork:
sudo apt install picom
如果你用的是 Wayland(如 GNOME/Wayland),Compton 不生效,它只支持 X11。
echo $XDG_SESSION_TYPE
输出应为:
x11
如果是 wayland,请切换回 X11 会话(登录界面选择)。
Compton 默认读取:
~/.config/compton.conf
创建并编辑:
mkdir -p ~/.config
nano ~/.config/compton.conf
backend = "glx";
glx-no-stencil = true;
shadow = true;
shadow-radius = 8;
shadow-offset-x = -2;
shadow-offset-y = -2;
shadow-opacity = 0.4;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
unredir-if-possible = true;
compton --config ~/.config/compton.conf &
在 ~/.config/openbox/autostart 或 i3 配置里加:
compton --config ~/.config/compton.conf &
设置 → 会话和启动 → 自启程序 → 添加:
compton --config ~/.config/compton.conf
urxvt, alacritty, kitty)尝试:
backend = "xrender";
unredir-if-possible = true;
| 项目 | compton | picom |
|---|---|---|
| 维护状态 | 基本停止 | 活跃 |
| 新特性 | 少 | blur、rounded |
| Debian 包 | compton | picom |
如果你想要 毛玻璃模糊:
blur-method = "kawase";
blur-strength = 5;
如果你告诉我:
我可以直接给你一份可直接用的配置文件。