在 Linux 下,Compton(现在很多发行版已改用它的分支 Picom)本身的“备份”通常就是指备份它的配置文件,以及(可选)相关启动脚本。下面按常见情况说明。
Compton 默认配置文件位置通常是:
~/.config/compton.conf
也可能是:
~/.compton.conf
/etc/compton.conf
Picom(Compton 分支)常见的是:
~/.config/picom/picom.conf
~/.config/picom.conf
你可以先确认:
ls -la ~/.config | grep -E "compton|picom"
cp ~/.config/compton.conf ~/.config/compton.conf.bak
或一次性打包:
tar czf compton-backup.tar.gz ~/.config/compton.conf
如果有多个相关文件:
tar czf compton-backup.tar.gz \
~/.config/compton.conf \
~/.config/autostart/compton.desktop
如果你用桌面环境(如 XFCE / KDE / GNOME)设置了开机启动:
~/.config/autostart/compton.desktop
备份:
cp ~/.config/autostart/compton.desktop ~/.config/autostart/compton.desktop.bak
如果你经常改配置,可以用 Git:
mkdir -p ~/dotfiles/compton
cp ~/.config/compton.conf ~/dotfiles/compton/
cd ~/dotfiles
git init
git add compton/compton.conf
git commit -m "backup compton config"
以后重装系统直接 clone 回来即可。
cp ~/.config/compton.conf.bak ~/.config/compton.conf
或解压:
tar xzf compton-backup.tar.gz -C ~/
然后重启 Compton:
killall compton
compton &
(Picom 用户替换为 picom)
picom,命令和路径几乎一样,只是名字不同which compton picom
如果你愿意,可以告诉我:
compton 还是 picom我可以给你更精确的备份命令。