zsh: Set SSH_AUTH_SOCK to GnuPG SSH agent socket
Alan Pearce alan@alanpearce.eu
Sat, 26 Aug 2017 17:03:46 +0200
1 files changed, 3 insertions(+), 2 deletions(-)
jump to
M zsh/.config/zsh/.zshenv → zsh/.config/zsh/.zshenv
@@ -10,9 +10,10 @@ then . $ZDOTDIR/zshenv.private fi - if [[ -z $SSH_AUTH_SOCK ]] + unset SSH_AGENT_PID + if [[ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]] then - export SSH_AUTH_SOCK=${XDG_RUNTIME_DIR:-/run/user/$UID}/ssh-agent + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" fi if [[ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]]