69 lines
1.7 KiB
Fish
Executable file
69 lines
1.7 KiB
Fish
Executable file
#!/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
|
|
|
|
mkdir -p ~/.cache
|
|
|
|
if set --query _flag_desktop
|
|
# Copy the desktop part
|
|
echo "**** Copying desktop part"
|
|
rsync --exclude=".*.swp" -av ./desktop/ ~/
|
|
pip install --user --break-system-packages -U poezio-omemo epr-reader
|
|
|
|
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
|
|
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"
|
|
rsync --exclude=".*.swp" -av ./root/ ~/
|
|
end
|
|
|
|
go install github.com/jesseduffield/lazydocker@latest
|
|
go install github.com/jesseduffield/lazygit@latest
|
|
|
|
rm -rf ~/.cache/nvimpager-git
|
|
git clone --depth 1 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 --exclude=".*.swp" -av ./common/ ~/
|