在 Linux 下,compton(现在更多被维护为 picom)的配置文件通常是纯文本文件,备份非常简单。下面分几种常见情况说明。
常见配置文件路径有:
~/.config/compton.conf
~/.config/picom.conf
/etc/xdg/compton.conf
/etc/xdg/picom.conf
也可以先查找:
ls -l ~/.config/compton.conf ~/.config/picom.conf
cp ~/.config/compton.conf ~/.config/compton.conf.bak
或(如果是 picom):
cp ~/.config/picom.conf ~/.config/picom.conf.bak
tar czf compton-backup.tar.gz ~/.config/compton.conf
或整个配置目录:
tar czf compton-config-backup.tar.gz -C ~/.config compton.conf
mkdir -p ~/dotfiles
cp ~/.config/compton.conf ~/dotfiles/
cd ~/dotfiles
git init
git add compton.conf
git commit -m "backup compton config"
以后可随时恢复或同步。
cp ~/.config/compton.conf.bak ~/.config/compton.conf
或解压:
tar xzf compton-backup.tar.gz -C ~/
picom --config ~/.config/picom.conf
如果你愿意,可以告诉我:
我可以给你更精确的备份和恢复方案。