diff --git a/zsh/.config/zsh/functions.zsh b/zsh/.config/zsh/functions.zsh index b34010a..4082fc8 100644 --- a/zsh/.config/zsh/functions.zsh +++ b/zsh/.config/zsh/functions.zsh @@ -27,6 +27,10 @@ get_ip() { eval "curl ${ARGS[@]} -fsSL 'https://ifconfig.co/json$IP' $JQ" } +gpg_ssh() { + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +} + http() { (( ${+commands[python]} )) || return 2 [[ $# -gt 0 ]] && local DIR="--directory=$1" && shift diff --git a/zsh/.config/zsh/gpg.zsh b/zsh/.config/zsh/gpg.zsh index 912c435..5853ce9 100644 --- a/zsh/.config/zsh/gpg.zsh +++ b/zsh/.config/zsh/gpg.zsh @@ -1,6 +1,5 @@ if [[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]]; then export GPG_TTY="$TTY" - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" gpgconf --launch gpg-agent gpg-connect-agent updatestartuptty /bye &> /dev/null fi diff --git a/zsh/.config/zsh/ssh.zsh b/zsh/.config/zsh/ssh.zsh new file mode 100644 index 0000000..0f87d12 --- /dev/null +++ b/zsh/.config/zsh/ssh.zsh @@ -0,0 +1,2 @@ +[[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]] && + eval "$(ssh-agent)" &> /dev/null