在 Debian 上安装 compton(现在更常见的是 picom,compton 的活跃分支)可以按下面步骤来。
Debian 10(Buster)及以后版本仓库里已经包含 picom(compton 的继任者):
sudo apt update
sudo apt install picom
说明:
- Debian 新版本中 compton 已被 picom 取代
- 命令名通常是
picom,但用法和 compton 基本一致
如果你一定要用旧版 compton(不推荐):
sudo apt install compton
picom &
或
compton &
如果成功,窗口阴影、透明效果等会立即生效。
~/.xinitrc 中(startx 用户)编辑 ~/.xinitrc:
picom &
exec dwm
(把 dwm 换成你自己的窗口管理器,如 i3、openbox 等)
在 ~/.config/i3/config 中加:
exec picom
在 ~/.config/openbox/autostart 中加:
picom &
创建配置目录:
mkdir -p ~/.config/picom
复制默认配置(如果有):
cp /usr/share/doc/picom/examples/picom.conf.example ~/.config/picom/picom.conf
或手动创建 ~/.config/picom/picom.conf,例如:
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 12;
shadow-offset-x = -15;
shadow-offset-y = -15;
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
opacity-rule = [
"90:class_g = 'Terminator'",
"95:class_g = 'Firefox'"
];
启动时使用配置:
picom --config ~/.config/picom/picom.conf &
alacritty、urxvt、xfce4-terminal)backend = "glx"ps aux | grep picom
✅ 推荐方案(Debian)
sudo apt install picom
picom &
如果你愿意,可以告诉我:
我可以给你一份完全定制的 picom 配置。