diff --git a/home/private_dot_config/zsh/zexists.d/cmd/gpg.zsh b/home/private_dot_config/zsh/zexists.d/cmd/gpg.zsh index 9f3327e..fa8899f 100644 --- a/home/private_dot_config/zsh/zexists.d/cmd/gpg.zsh +++ b/home/private_dot_config/zsh/zexists.d/cmd/gpg.zsh @@ -2,3 +2,10 @@ export GPG_TTY="$TTY" gpgconf --launch gpg-agent + +# have gpg-agent be the ssh-agent +# idea taken from https://wiki.archlinux.org/title/GnuPG#SSH_agent +if [[ -z "${SSH_CONNECTION}" ]]; then + export SSH_AGENT_PID="" + export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh" +fi