From 1837aae7cc023d7f20da3f815e6444b4914ffc34 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 8 Oct 2023 19:41:13 +0200 Subject: [PATCH] Its better when it works --- .config/fish/conf.d/alias.fish | 3 --- .config/fish/functions/ssh-export.fish | 11 +++++++++++ Makefile | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .config/fish/functions/ssh-export.fish diff --git a/.config/fish/conf.d/alias.fish b/.config/fish/conf.d/alias.fish index c4806fb..972db49 100644 --- a/.config/fish/conf.d/alias.fish +++ b/.config/fish/conf.d/alias.fish @@ -6,9 +6,6 @@ alias mirrors_update "curl -s 'https://archlinux.org/mirrorlist/?country=FR&coun alias pacman-clean "sudo pacman -Rsn \$(pacman -Qqtd) --noconfirm" alias untgz "tar xvzf" alias paru-rebuild "checkrebuild | awk '{print \$2}' | xargs -r paru -S --rebuild=all --noconfirm" -alias ssh-export "cd $HOME/.ssh && \ - tar cz --exclude='known_hosts*' -X 'environment' -f '$HOME/SSH.tar.gz' * && \ - if not test $PWD -ef $HOME/.ssh; cd -; end; true" alias ssh-fix "sudo chown $USER:$(id -gn) $HOME/.ssh/* && \ sudo chmod u=r,g=,o= $HOME/.ssh/*; \ sudo chmod u=r,g=r,o=r $HOME/.ssh/*.pub; \ diff --git a/.config/fish/functions/ssh-export.fish b/.config/fish/functions/ssh-export.fish new file mode 100644 index 0000000..9cd88a0 --- /dev/null +++ b/.config/fish/functions/ssh-export.fish @@ -0,0 +1,11 @@ +function ssh-export + # Save the entry directory + set entry_directory $PWD + + # Create the archive + cd $HOME/.ssh + tar cz --exclude='known_hosts*' -X environment -f '$HOME/SSH.tar.gz' * + + # Returns to the entry directory + cd $entry_directory +end diff --git a/Makefile b/Makefile index ff5c6db..20ed003 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ sync-dotconfig: @$(WGET) $(REPO_SRC)/.config/fish/functions/fish_prompt.fish -O $(HOME)/.config/fish/functions/fish_prompt.fish @$(WGET) $(REPO_SRC)/.config/fish/functions/makeaway.fish -O $(HOME)/.config/fish/functions/makeaway.fish + @$(WGET) $(REPO_SRC)/.config/fish/functions/ssh-export.fish -O $(HOME)/.config/fish/functions/ssh-export.fish @$(WGET) $(REPO_SRC)/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish @$(WGET) $(REPO_SRC)/.config/fish/conf.d/alias.fish -O $(HOME)/.config/fish/conf.d/alias.fish