在 Linux 下 Compton(现在多被分支 picom 取代)本身只是个合成器(compositor),“备份 Compton”通常指备份它的配置文件和相关启动方式。下面分情况说明。
Compton 常见配置文件位置:
~/.config/compton.conf
~/.compton.conf
/etc/xdg/compton.conf
picom 常见配置:
~/.config/picom.conf
~/.config/picom/picom.conf
cp ~/.config/compton.conf ~/compton.conf.bak
或整体备份配置目录:
cp -r ~/.config/compton ~/compton_backup
如果你在以下地方配置了 Compton 开机启动,也需要备份:
~/.config/autostart/compton.desktop
~/.config/autostart/picom.desktop
备份:
cp ~/.config/autostart/compton.desktop ~/compton.desktop.bak
例如 i3:
~/.config/i3/config
查找是否有:
exec --no-startup-id compton
备份 i3 配置:
cp ~/.config/i3/config ~/i3.config.bak
如果你想要“整体备份”:
tar czvf compton_backup.tar.gz \
~/.config/compton.conf \
~/.config/compton \
~/.config/picom.conf \
~/.config/autostart/compton.desktop \
~/.config/i3/config
sudo cp /etc/xdg/compton.conf /etc/xdg/compton.conf.bak
cp ~/compton.conf.bak ~/.config/compton.conf
然后重启 Compton:
pkill compton
compton &
或(picom):
pkill picom
picom &
如果你愿意,可以告诉我:
✅ 用的发行版
✅ 桌面环境(GNOME / KDE / i3 / bspwm)
✅ 是 compton 还是 picom
我可以给你一对一的备份命令。