在 Ubuntu 下,Compton(现在很多发行版改用它的 fork:picom)的配置文件通常是纯文本,备份非常简单。下面按常见情况说明。
Compton 的配置文件常见位置有:
用户目录
~/.config/compton.conf
或
~/.config/picom.conf
旧版本可能在主目录
~/.compton.conf
系统级配置(不常见)
/etc/xdg/compton.conf
你可以先查看:
ls -l ~/.config/compton.conf ~/.config/picom.conf ~/.compton.conf
cp ~/.config/compton.conf ~/.config/compton.conf.bak
或(如果是 picom):
cp ~/.config/picom.conf ~/.config/picom.conf.bak
tar czvf compton-config-backup.tar.gz ~/.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
然后重启 Compton / picom:
killall compton
compton &
或
killall picom
picom &
apt list --installed | grep -E "compton|picom"
如果你愿意,可以告诉我:
我可以给你更精确的命令。