在 Ubuntu 上“备份 Compton”通常指两种情况之一:
下面分别说明。
Compton 的配置文件一般位于:
~/.config/compton.conf
或者旧版本:
~/.compton.conf
ls -la ~/.config/compton.conf
ls -la ~/.compton.conf
cp ~/.config/compton.conf ~/compton.conf.bak
或整体备份配置目录:
cp -r ~/.config/compton.conf /mnt/backup/
cp ~/compton.conf.bak ~/.config/compton.conf
which compton
dpkg -l | grep compton
如果是 apt 安装:
sudo apt list --installed | grep compton
重装命令:
sudo apt install compton
需要备份:
/usr/local/bin/compton)如果你用 systemd 管理 Compton:
~/.config/systemd/user/compton.service
备份:
cp ~/.config/systemd/user/compton.service ~/compton.service.bak
如果是 .xinitrc 或 .profile 启动:
grep compton ~/.xinitrc ~/.profile ~/.bashrc
mkdir ~/compton-backup
cp ~/.config/compton.conf ~/compton-backup/
cp ~/.config/systemd/user/compton.service ~/compton-backup/ 2>/dev/null
dpkg -l | grep compton > ~/compton-backup/installed.txt
⚠️ 现在很多 Ubuntu 用户已改用 picom(Compton 的 fork)
检查方法:
which picom
如果是 picom,配置文件通常是:
~/.config/picom.conf
如果你愿意,可以告诉我:
我可以给你更精确的备份方案。