From b19e02bc6c0b39518a5a28d4997ef80c0495e8c2 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 22 Oct 2024 10:53:48 -0500 Subject: [PATCH] gpg is my ssh-agent now --- home/private_dot_config/zsh/zexists.d/cmd/gpg.zsh | 7 +++++++ 1 file changed, 7 insertions(+) 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