在 Linux 中,Compton 是一个轻量级的 X11 合成管理器(现在多数发行版已被 picom 取代,picom 是 compton 的活跃分支)。下面分别说明如何配置和启动 compton / picom。
sudo apt install compton
# 或新版推荐
sudo apt install picom
sudo pacman -S compton
# 或
sudo pacman -S picom
sudo dnf install compton
Compton 默认读取配置文件:
~/.config/compton.conf
如果是 picom:
~/.config/picom.conf
如果不存在,可以新建:
mkdir -p ~/.config
touch ~/.config/compton.conf
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
opacity-rule = [
"90:class_g = 'URxvt'",
"95:class_g = 'Firefox'"
];
unredir-if-possible = true;
compton &
或(picom):
picom &
compton --config ~/.config/compton.conf &
将下面命令加入:
gnome-session-propertiescompton --config ~/.config/compton.conf
.xinitrc(startx 用户)编辑 ~/.xinitrc:
compton --config ~/.config/compton.conf &
exec dwm
在配置文件中加入:
exec --no-startup-id compton --config ~/.config/compton.conf
尝试:
backend = "xrender";
vsync = false;
建议直接使用 picom:
picom --config ~/.config/picom.conf
如果你告诉我:
我可以给你更精准的启动方式。