2023-09-02 21:48:52 +02:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
argparse 'R/remove' 'r/root' 'd/desktop' 'h/help' -- $argv
|
|
|
|
|
|
|
|
if set --query _flag_help
|
|
|
|
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
|
|
|
|
end
|
|
|
|
|
2023-09-03 18:26:58 +02:00
|
|
|
mkdir -p ~/.cache
|
|
|
|
|
2023-09-02 21:48:52 +02:00
|
|
|
if set --query _flag_desktop
|
|
|
|
# Copy the desktop part
|
|
|
|
echo "**** Copying desktop part"
|
2023-09-03 00:36:15 +02:00
|
|
|
rsync --exclude=".*.swp" -av ./desktop/ ~/
|
2023-09-02 21:48:52 +02:00
|
|
|
pip install --user --break-system-packages -U poezio-omemo epr-reader
|
2023-09-03 18:26:58 +02:00
|
|
|
|
|
|
|
rm -rf ~/.local/share/poezio/plugins
|
|
|
|
mkdir -p ~/.local/share/poezio
|
|
|
|
|
|
|
|
set -l poezio_version $(poezio --version | cut -d " " -f 2)
|
|
|
|
rm -rf ~/.cache/poezio-git
|
|
|
|
git clone --depth 1 https://codeberg.org/poezio/poezio ~/.cache/poezio-git
|
|
|
|
pushd ~/.cache/poezio-git
|
|
|
|
git checkout $poezio_version
|
|
|
|
popd
|
|
|
|
cp -r ~/.cache/poezio-git/plugins ~/.local/share/poezio
|
|
|
|
rm -rf ~/.cache/poezio-git
|
2023-09-02 21:48:52 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
if set --query _flag_remove
|
|
|
|
echo "**** Remove old config"
|
|
|
|
|
|
|
|
# Remove zsh
|
|
|
|
rm ~/.zcompdump
|
|
|
|
rm -rf ~/.zsh* ~/.local/share/zsh
|
|
|
|
|
|
|
|
# Remove old tmux files
|
|
|
|
rm -f ~/.tmux.conf ~/.tmux-theme
|
|
|
|
|
|
|
|
rm -f ~/.config/fish/cd.fish
|
|
|
|
end
|
|
|
|
|
|
|
|
if set --query _flag_root
|
|
|
|
echo "**** Copying root part"
|
2023-09-03 00:36:15 +02:00
|
|
|
rsync --exclude=".*.swp" -av ./root/ ~/
|
2023-09-02 21:48:52 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
go install github.com/jesseduffield/lazydocker@latest
|
|
|
|
go install github.com/jesseduffield/lazygit@latest
|
|
|
|
|
|
|
|
rm -rf ~/.cache/nvimpager-git
|
2023-09-03 18:26:58 +02:00
|
|
|
git clone --depth 1 https://github.com/lucc/nvimpager ~/.cache/nvimpager-git
|
2023-09-02 21:48:52 +02:00
|
|
|
pushd ~/.cache/nvimpager-git
|
|
|
|
make PREFIX=$HOME/.local install
|
|
|
|
popd
|
|
|
|
rm -rf ~/.cache/nvimpager-git
|
|
|
|
|
|
|
|
# Copy the common part
|
2023-09-03 00:36:15 +02:00
|
|
|
rsync --exclude=".*.swp" -av ./common/ ~/
|