在 Ubuntu 上,Compton 是一个常见的 X11 合成器(现在多数分支叫 picom)。备份它的配置通常只需要复制配置文件和相关启动项即可。
Compton 的配置文件通常位于以下位置之一:
~/.config/compton.conf
或
~/.compton.conf
/etc/compton.conf
/etc/xdg/compton.conf
你可以用以下命令查找:
ls -l ~/.config/compton.conf ~/.compton.conf /etc/compton.conf 2>/dev/null
cp ~/.config/compton.conf ~/compton.conf.bak
或
cp ~/.compton.conf ~/compton.conf.bak
tar czvf compton-backup.tar.gz ~/.config/compton.conf
或
tar czvf compton-backup.tar.gz ~/.compton.conf
很多新系统已经用 picom 代替 compton:
配置文件可能是:
~/.config/picom/picom.conf
备份命令:
cp ~/.config/picom/picom.conf ~/.config/picom/picom.conf.bak
Compton 通常通过以下方式启动:
~/.config/autostart/compton.desktop
或
~/.config/autostart/picom.desktop
备份:
cp ~/.config/autostart/compton.desktop ~/compton.desktop.bak
检查配置文件:
~/.i3/config
~/.config/openbox/autostart
查找是否包含:
exec compton &
或
exec picom &
mkdir -p ~/backup/compton
cp ~/.config/compton.conf ~/backup/compton/ 2>/dev/null
cp ~/.compton.conf ~/backup/compton/ 2>/dev/null
cp ~/.config/picom/picom.conf ~/backup/compton/ 2>/dev/null
cp ~/.config/autostart/compton.desktop ~/backup/compton/ 2>/dev/null
cp ~/.config/autostart/picom.desktop ~/backup/compton/ 2>/dev/null
echo "Compton 配置已备份到 ~/backup/compton"
cp ~/compton.conf.bak ~/.config/compton.conf
然后重启会话或运行:
compton --restart
或
picom --restart
如果你愿意,可以告诉我:
我可以给你更精确的备份方案。