在 Ubuntu 上“开启 Compton”通常是指启用 Compton 作为窗口合成器(用于透明、阴影、动画、减少撕裂等)。下面按常见情况说明:
compton 包在部分 Ubuntu 版本里仍存在,但建议用 picomsudo apt update
sudo apt install picom
sudo apt install compton
picom &
# 或
compton &
如果能看到透明 / 阴影生效,说明可用。
在 ~/.xinitrc 或桌面自启配置里加:
picom &
例如 i3:
echo "exec --no-startup-id picom" >> ~/.config/i3/config
⚠️ 注意:
如果你确实要开(比如解决撕裂):
picom --backend glx &
并在“启动应用程序”里添加。
mkdir -p ~/.config/picom
cp /etc/xdg/picom.conf ~/.config/picom/picom.conf
常用开关:
opacity-rule = [ "90:class_g = 'Alacritty'" ];
shadow = true;
fading = true;
picom --backend xrender
picom --vsync
✅ 用 i3 / Openbox → 必须开
❌ 用 Ubuntu GNOME → 一般不用
如果你告诉我:
我可以给你精确的一行命令配置。