summaryrefslogtreecommitdiffstatshomepage
path: root/gnupg/.config
diff options
context:
space:
mode:
Diffstat (limited to 'gnupg/.config')
-rw-r--r--gnupg/.config/profile.d/20-gnupg.sh8
-rw-r--r--gnupg/.config/zsh/.zshrc.d/20-gnupg.zsh2
2 files changed, 8 insertions, 2 deletions
diff --git a/gnupg/.config/profile.d/20-gnupg.sh b/gnupg/.config/profile.d/20-gnupg.sh
index 25e9033..1eb429a 100644
--- a/gnupg/.config/profile.d/20-gnupg.sh
+++ b/gnupg/.config/profile.d/20-gnupg.sh
@@ -1,6 +1,10 @@
#!/bin/sh
GPG_AGENT_SOCK="$(gpgconf --list-dirs agent-socket)"
-SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
+export GPG_AGENT_SOCK
-export GPG_AGENT_SOCK SSH_AUTH_SOCK
+unset SSH_AGENT_PID
+if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
+ SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
+ export SSH_AUTH_SOCK
+fi
diff --git a/gnupg/.config/zsh/.zshrc.d/20-gnupg.zsh b/gnupg/.config/zsh/.zshrc.d/20-gnupg.zsh
index f9c4fdc..3348c83 100644
--- a/gnupg/.config/zsh/.zshrc.d/20-gnupg.zsh
+++ b/gnupg/.config/zsh/.zshrc.d/20-gnupg.zsh
@@ -4,4 +4,6 @@
GPG_TTY=$(tty)
export GPG_TTY
+gpg-connect-agent updatestartuptty /bye >/dev/null
+
alias unlock='echo "" | gpg --clearsign 1>/dev/null && ssh localhost -- : 1>/dev/null'