Compton 是 Linux 下常用的 X11 窗口合成器(现在很多发行版已改名为 picom)。下面从 安装 → 基础配置 → 常用参数 → 示例配置 给你一个完整说明。
echo $XDG_SESSION_TYPE
输出 x11 才适用 compton/picom。
sudo apt install compton
或(推荐):
sudo apt install picom
sudo pacman -S picom
sudo dnf install picom
✅ 建议直接用 picom,compton 已经停止维护。
picom &
在 ~/.xinitrc 或 WM 的 autostart 中加入:
picom &
picom 默认读取:
~/.config/picom/picom.conf
如果不存在,可以复制默认配置:
mkdir -p ~/.config/picom
picom --show-config > ~/.config/picom/picom.conf
shadow = true;
shadow-radius = 12;
shadow-offset-x = -15;
shadow-offset-y = -15;
shadow-opacity = 0.5;
opacity-rule = [
"90:class_g = 'Alacritty'",
"85:class_g = 'Firefox'"
];
或全局透明:
inactive-opacity = 0.9;
active-opacity = 1.0;
blur-method = "gaussian";
blur-strength = 8;
⚠️ 模糊对性能有一定影响。
unredir-if-possible = true;
或排除特定窗口:
shadow-exclude = [
"class_g = 'Conky'",
"class_g = 'Polybar'"
];
vsync = true;
backend = "glx";
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 12;
shadow-offset-x = -15;
shadow-offset-y = -15;
shadow-opacity = 0.5;
fade = true;
fade-delta = 5;
inactive-opacity = 0.9;
active-opacity = 1.0;
blur-method = "gaussian";
blur-strength = 6;
unredir-if-possible = true;
shadow-exclude = [
"class_g = 'Polybar'",
"class_g = 'Conky'"
];
ps aux | grep picom
killall picom
picom &
尝试:
picom --backend xrender
| 项目 | Compton | Picom |
|---|---|---|
| 维护状态 | ❌ 停止 | ✅ 活跃 |
| Wayland | ❌ | ❌ |
| 推荐 | ❌ | ✅ |
如果你告诉我:
我可以直接给你一份 最适合你机器的 picom 配置。