在 Linux 里 Compton(现在多称为 picom) 实现“透明”通常有两种层面:
下面按常见用法说明。
# Debian / Ubuntu
sudo apt install compton
# Arch
sudo pacman -S picom
# Fedora
sudo dnf install picom
新版本一般叫
picom,配置方式一样。
mkdir -p ~/.config/compton
nvim ~/.config/compton/compton.conf
(也可用 picom.conf)
opacity-rule = [
"90:class_g = 'URxvt'",
"80:class_g = 'Alacritty'",
"95:class_g = 'Firefox'"
];
含义:
90 → 90% 不透明度(10% 透明)class_g → 窗口类名opacity-rule = [
"85:name = '.*'"
];
Alacritty
background_opacity: 0.85
Kitty
background_opacity 0.85
URxvt
URxvt.depth: 32
URxvt.background: rgba:0000/0000/0000/cccc
inactive-opacity = 0.8;
active-opacity = 1.0;
效果:
opacity-rule = [
"100:class_g = 'Rofi'",
"100:class_g = 'dmenu'"
];
compton --config ~/.config/compton/compton.conf &
或
picom --config ~/.config/compton/compton.conf &
开机自启(i3 示例):
exec --no-startup-id picom
ps aux | grep picom
如果你告诉我:
我可以给你一份直接可用的配置。