在 Debian 上配置 Compton(现在社区更多用它的继任者 Picom,但命令和配置基本通用)一般分为下面几个步骤:
sudo apt update
sudo apt upgrade
# Compton(旧版)
sudo apt install compton
# 或推荐安装 Picom(新版,兼容 Compton 配置)
sudo apt install picom
Compton 需要 非合成(non-compositing) 环境才能发挥作用:
查看当前会话:
echo $XDG_CURRENT_DESKTOP
mkdir -p ~/.config/compton
compton --help
man compton
或直接创建:
nano ~/.config/compton/compton.conf
# 阴影
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
shadow-offset-x = -2;
shadow-offset-y = -2;
# 透明
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
# 淡入淡出
fade = true;
fade-delta = 2;
# 后端
backend = "glx";
vsync = true;
# 排除
unredir-if-possible = true;
如果是 picom,配置文件是:
~/.config/picom/picom.conf
compton --config ~/.config/compton/compton.conf
或
picom --config ~/.config/picom/picom.conf
在 ~/.config/i3/config 中加入:
exec --no-startup-id compton --config ~/.config/compton/compton.conf
Openbox 在 ~/.config/openbox/autostart:
compton --config ~/.config/compton/compton.conf &
backend = "xrender"vsyncglx 后端如果你告诉我 用的是哪个窗口管理器(i3 / bspwm / Openbox),我可以给你一份可直接用的配置文件。