Ubuntu下切换 Compton 与 Mutter 的实用步骤
前置说明
快速切换一览
| 会话类型 | 要使用的合成器 | 切换操作 | 验证方式 |
|---|---|---|---|
| GNOME on Xorg | Mutter | 注销 → 齿轮图标选择 Ubuntu on Xorg → 登录 | echo $XDG_SESSION_TYPE 显示 x11;pgrep -x mutter 有输出 |
| GNOME on Xorg | Compton | 安装并配置自启 → 注销 → 选 Ubuntu on Xorg → 登录 | pgrep -x compton 有输出;pgrep -x mutter 无输出 |
| GNOME on Wayland | Mutter | 注销 → 齿轮图标选择 Ubuntu(Wayland)→ 登录 | echo $XDG_SESSION_TYPE 显示 wayland;pgrep -x mutter 有输出 |
| i3/Openbox 等 | Compton | 在会话配置中启动 Compton(如 i3 的 config 中 exec --no-startup-id compton) | pgrep -x compton 有输出 |
在 GNOME on Xorg 中切换到 Compton
sudo apt update && sudo apt install comptonmkdir -p ~/.config && cp /etc/xdg/compton.conf ~/.config/compton.conf(如文件不存在可手动创建)compton --config ~/.config/compton.confkillall mutter 2>/dev/null; compton --config ~/.config/compton.conf &echo $XDG_SESSION_TYPE 应为 x11;pgrep -x compton 应有进程,pgrep -x mutter 应无进程。在 GNOME on Xorg 中切回 Mutter
killall comptonsystemctl --user stop compton && systemctl --user disable comptonpgrep -x mutter 应有进程,pgrep -x compton 应无进程。在 GNOME on Wayland 下的说明
常见问题与排错
vsync true),或先用极简配置验证:compton --config ~/.config/compton.conf --vsync &cp /etc/xdg/compton.conf ~/.config/compton.conf 后再按需修改。