在 Debian 上启用 Compton(现在更常见的是它的继任者 Picom,功能兼容 Compton 配置),通常用于为无独立合成器的窗口管理器(如 i3、Openbox、Awesome 等)提供透明、阴影、淡入淡出等特效。
下面以 Debian + Compton(或 Picom) 为例说明。
sudo apt update
sudo apt install compton
sudo apt update
sudo apt install picom
下文命令中
compton和picom可互换使用。
compton &
# 或
picom &
如果能看到窗口透明、阴影生效,说明运行正常。
编辑 ~/.config/i3/config:
exec --no-startup-id compton
编辑 ~/.config/openbox/autostart:
compton &
创建文件:
~/.config/systemd/user/compton.service
内容:
[Unit]
Description=Compton compositor
After=graphical.target
[Service]
ExecStart=/usr/bin/compton
Restart=on-failure
[Install]
WantedBy=default.target
启用:
systemctl --user daemon-reload
systemctl --user enable --now compton
配置文件位置:
~/.config/compton.conf
# 或
~/.config/picom.conf
示例(简单透明 + 阴影):
backend = "glx";
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
fade = true;
opacity-rule = [
"90:class_g = 'URxvt'"
];
启动指定配置:
compton --config ~/.config/compton.conf
尝试:
compton --backend xrender
建议使用:
backend = "xrender";
vsync = false;
ps aux | grep compton
picom 替代 compton如果你用的是 具体窗口管理器(i3 / dwm / awesome)或显卡类型,我可以给你更精确的配置。