在 Ubuntu 上“备份 compton”通常有两种理解:
下面分别说明。
Compton 的配置文件一般位于:
~/.config/compton.conf
或旧版本:
~/.compton.conf
cp ~/.config/compton.conf ~/compton.conf.bak
或(如果文件在 home 目录):
cp ~/.compton.conf ~/compton.conf.bak
cp -r ~/.config/compton ~/.config/compton.bak
which compton
dpkg -l | grep compton
可记录安装信息:
dpkg --get-selections | grep compton > compton_packages.txt
重装时:
sudo apt install compton
Compton 常通过以下方式启动:
查看:
~/.config/autostart/compton.desktop
备份:
cp ~/.config/autostart/compton.desktop ~/compton.desktop.bak
例如 i3:
~/.config/i3/config
查找:
exec --no-startup-id compton
mkdir -p ~/backup/compton
cp ~/.config/compton.conf ~/backup/compton/ 2>/dev/null
cp ~/.compton.conf ~/backup/compton/ 2>/dev/null
cp ~/.config/autostart/compton.desktop ~/backup/compton/ 2>/dev/null
cp ~/backup/compton/compton.conf ~/.config/compton.conf
然后重启 Compton:
killall compton
compton &
如果你用的是 picom(compton 的继任者),命令几乎一样,只是把 compton 换成 picom 即可。
如果你愿意,可以告诉我:
我可以给你更精确的备份方案。