在 Linux 上“备份 compton”通常指两件事之一:
下面分别说明。
Compton 的配置文件通常位于:
~/.config/compton.conf~/.compton.conf/etc/compton.conf(较少见)ls -l ~/.config/compton.conf ~/.compton.conf /etc/compton.conf 2>/dev/null
cp ~/.config/compton.conf ~/compton.conf.bak
或一次性备份所有相关文件:
mkdir -p ~/backup/compton
cp ~/.config/compton.conf ~/backup/compton/ 2>/dev/null
cp ~/.compton.conf ~/backup/compton/ 2>/dev/null
cp ~/compton.conf.bak ~/.config/compton.conf
dpkg -l | grep compton > ~/backup/compton/pkg.txt
重装时:
sudo apt install compton
备份源码目录即可:
cp -r ~/compton-src ~/backup/compton/
现代系统中 Compton 多已被 picom 替代:
~/.config/picom.confcp ~/.config/picom.conf ~/picom.conf.bak
#!/bin/bash
mkdir -p ~/backup/compton
cp ~/.config/compton.conf ~/backup/compton/ 2>/dev/null
cp ~/.compton.conf ~/backup/compton/ 2>/dev/null
echo "Compton 配置已备份到 ~/backup/compton"
如果你能说明:
我可以给你更精确的命令。