备份 Compton 配置非常简单,主要取决于你使用的是 Compton 还是它的一些分支(如 picom)。下面是常见做法:
Compton 的配置通常位于以下位置之一:
~/.config/compton.conf
或
~/.compton.conf
如果两者都存在,一般优先使用
~/.config/compton.conf
picom 的配置通常是:
~/.config/picom/picom.conf
或
~/.config/picom.conf
cp ~/.config/compton.conf ~/.config/compton.conf.bak
或(如果是 picom):
cp ~/.config/picom/picom.conf ~/.config/picom/picom.conf.bak
tar czvf compton_backup.tar.gz ~/.config/compton.conf
或:
tar czvf picom_backup.tar.gz ~/.config/picom/
如果你不确定用的是哪个配置文件,可以运行:
ps aux | grep compton
或:
pgrep -a compton
可能会看到类似:
compton --config /home/user/.config/compton.conf
恢复时只需复制回去即可:
cp ~/.config/compton.conf.bak ~/.config/compton.conf
然后重启 Compton:
killall compton
compton &
mkdir -p ~/dotfiles
cp ~/.config/compton.conf ~/dotfiles/
cd ~/dotfiles
git init
git add compton.conf
git commit -m "Backup compton config"
这样以后换系统也能快速恢复。
如果你愿意,可以把你的 compton.conf 内容贴出来,我可以帮你检查是否适合当前显卡 / 桌面环境(i3、Openbox、Awesome 等)。