在 Debian 上使用的 Compton(现在更多被称为 Picom,Compton 的活跃分支)是一个轻量级的 X11 合成管理器,常用于实现窗口透明、阴影、模糊等特效。
下面按常见配置类别说明 Compton / Picom 支持的主要配置项(适用于 Debian 及大多数 Linux 发行版)。
通常配置文件位于:
~/.config/compton.conf
# 或
~/.config/picom.conf
常见启动参数(命令行):
compton -b # 后台运行
compton --config ~/.config/compton.conf
opacity-rule = [
"80:class_g = 'URxvt'",
"90:class_g = 'Firefox'"
];
全局透明:
inactive-opacity = 0.8;
active-opacity = 1.0;
shadow = true;
shadow-radius = 12;
shadow-offset-x = -2;
shadow-offset-y = -2;
shadow-opacity = 0.5;
排除某些窗口:
shadow-exclude = [
"class_g = 'Dmenu'",
"name = 'Notification'"
];
blur-method = "gaussian";
blur-size = 10;
blur-strength = 5;
背景模糊:
blur-background = true;
blur-background-frame = true;
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-delta = 5;
vsync = true;
refresh-rate = 60;
后端选择:
backend = "glx"; # 或 xrender
focus-exclude = "class_g = 'Conky'";
unredir-if-possible = true;
避免全屏游戏卡顿:
unredir-if-possible = true;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
Debian 默认仓库
sudo apt install compton
或使用更现代的:
sudo apt install picom
i3 / Openbox 用户常用
~/.xinitrc 或窗口管理器配置中自启picom --config ~/.config/picom.conf &
Wayland 不支持
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 8;
fading = true;
inactive-opacity = 0.9;
如果你愿意,我可以: