From 4fd4765af43ef06ff4421c9f6d6a950a8bd80e73 Mon Sep 17 00:00:00 2001 From: vonProteus <> Date: Sat, 27 Apr 2024 10:59:53 +0200 Subject: [PATCH] ssh with gpg-agent --- zsh.d/50_gpg-agent.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 zsh.d/50_gpg-agent.zsh diff --git a/zsh.d/50_gpg-agent.zsh b/zsh.d/50_gpg-agent.zsh new file mode 100644 index 0000000..2336bc2 --- /dev/null +++ b/zsh.d/50_gpg-agent.zsh @@ -0,0 +1,17 @@ +# vim: ft=zsh + +if command-exists "gpg-agent"; then + # on OS X with GPGTools, comment out the next line: + if [[ "$OSTYPE" != "darwin"* ]]; then + # non OSX + eval $(gpg-agent --daemon) + fi + + GPG_TTY=$(tty) + export GPG_TTY + if [ -f "${HOME}/.gpg-agent-info" ]; then + . "${HOME}/.gpg-agent-info" + export GPG_AGENT_INFO + export SSH_AUTH_SOCK + fi +fi