homes/update-home.sh
2023-09-02 01:19:36 +02:00

57 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
optstring="Rrdh"
while getopts ${optstring} arg; do
case ${arg} in
h)
echo "Update home with config files"
echo "WARNING: ERASE YOUR ACTUAL CONFIG"
echo
echo "Usage:"
echo "-d : copy desktop files"
echo "-r : copy root files"
echo "-R : remove old homes config"
echo "-h : this help"
echo
echo "You have to launch an other script to override secrets after"
exit
;;
d)
# Copy the desktop part
echo "**** Copying desktop part"
rsync -av ./desktop/ ~/
pip install --user --break-system-packages -U poezio-omemo epr-reader
sed -i "s/REPLACEDEVICEHOSTNAME/`hostname`/g" ~/.config/poezio/poezio.cfg
;;
R)
echo "**** Remove old config"
# Remove zsh
rm ~/.zcompdump
rm -rf ~/.zsh*
# Remove old tmux files
rm -f ~/.tmux.conf ~/.tmux-theme
rm -f ~/.config/fish/cd.fish
;;
r)
echo "**** Copying root part"
rsync -av ./root/ ~/
esac
done
go install github.com/jesseduffield/lazydocker@latest
go install github.com/jesseduffield/lazygit@latest
rm -rf ~/.cache/nvimpager-git
mkdir -p ~/.cache
git clone https://github.com/lucc/nvimpager ~/.cache/nvimpager-git
pushd ~/.cache/nvimpager-git
make PREFIX=$HOME/.local install
popd
rm -rf ~/.cache/nvimpager-git
# Copy the common part
rsync -av ./common/ ~/