From ac2287dbfcdce6fd6d0a3edde8964d424789c277 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Tue, 14 Mar 2023 15:57:38 +0100 Subject: [PATCH] Always add SSH keys to ssh-agent --- zsh/.config/zsh/.zlogout | 3 +-- zsh/.config/zsh/options.zsh | 3 +++ zsh/.config/zsh/ssh.zsh | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/zsh/.config/zsh/.zlogout b/zsh/.config/zsh/.zlogout index 65f8f8c..5c221ab 100644 --- a/zsh/.config/zsh/.zlogout +++ b/zsh/.config/zsh/.zlogout @@ -6,5 +6,4 @@ kill_services() { } [[ $(. /etc/os-release && echo $ID) == "artix" ]] && [[ $(tty) == "/dev/tty1" ]] && - kill_services >/dev/null -unfunction kill_services + kill_services &> /dev/null diff --git a/zsh/.config/zsh/options.zsh b/zsh/.config/zsh/options.zsh index 34b9830..564c107 100644 --- a/zsh/.config/zsh/options.zsh +++ b/zsh/.config/zsh/options.zsh @@ -7,5 +7,8 @@ zstyle ':completion:*' menu yes select # Friendly names in Antidote zstyle ':antidote:bundle' use-friendly-names 'yes' +# Extended globs +setopt extendedglob + # Right indentation off ZLE_RPROMPT_INDENT=0 diff --git a/zsh/.config/zsh/ssh.zsh b/zsh/.config/zsh/ssh.zsh index 0f87d12..55bc938 100644 --- a/zsh/.config/zsh/ssh.zsh +++ b/zsh/.config/zsh/ssh.zsh @@ -1,2 +1,6 @@ -[[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]] && - eval "$(ssh-agent)" &> /dev/null +if [[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]]; then + { + eval "$(ssh-agent)" + ssh-add ~/.ssh/id_^*.pub + } &> /dev/null +fi