From 8436344542c62c975d16fdb32c13017b0034ceb1 Mon Sep 17 00:00:00 2001 From: "kujiu (@uberwald)" Date: Sat, 2 Sep 2023 21:48:52 +0200 Subject: [PATCH] Update script from sh to fish --- README.rst | 1 + update-home.fish | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ update-home.sh | 57 ------------------------------------------------ 3 files changed, 58 insertions(+), 57 deletions(-) create mode 100755 update-home.fish delete mode 100755 update-home.sh diff --git a/README.rst b/README.rst index 0270938..05e930a 100644 --- a/README.rst +++ b/README.rst @@ -40,3 +40,4 @@ You need to install: - toot - unoconv - vdirsyncer +- vlock diff --git a/update-home.fish b/update-home.fish new file mode 100755 index 0000000..56af469 --- /dev/null +++ b/update-home.fish @@ -0,0 +1,57 @@ +#!/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 + +if set --query _flag_desktop + # 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 +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 -av ./root/ ~/ +end + +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/ ~/ diff --git a/update-home.sh b/update-home.sh deleted file mode 100755 index 98d5a83..0000000 --- a/update-home.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/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/ ~/