. /etc/bash_completion
fi
-envfile="$HOME/.gnupg/gpg-agent.env"
-if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then
- eval "$(cat "$envfile")"
-else
- eval "$(gpg-agent --daemon --enable-ssh-support --write-env-file "$envfile")"
-fi
-export GPG_AGENT_INFO # the env file does not contain the export statement
-export SSH_AUTH_SOCK # enable gpg-agent for ssh
-
export TMPDIR="/home/max/.local/tmp"
+
+gpg-agent --daemon --enable-ssh-support \
+ --write-env-file "${HOME}/.gpg-agent-info"
PS1+="\$ "
}
PROMPT_COMMAND=__prompt_command
+
+
+if [ -f "${HOME}/.gpg-agent-info" ]; then
+ . "${HOME}/.gpg-agent-info"
+ export GPG_AGENT_INFO
+ export SSH_AUTH_SOCK
+fi
+
+
+# Set GPG TTY
+export GPG_TTY=$(tty)