aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--_profile11
1 files changed, 11 insertions, 0 deletions
diff --git a/_profile b/_profile
index 237a91c..9eda66f 100644
--- a/_profile
+++ b/_profile
@@ -86,3 +86,14 @@ export LESS="--ignore-case --raw-control-chars"
if _exists dircolors; then
eval $(dircolors -b)
fi
+
+## gpg-agent: start it if not running
+if ! _running gpg-agent; then
+ gpg-connect-agent /bye &> /dev/null
+fi
+
+## Set SSH to use 'gpg-agent'
+unset SSH_AGENT_PID
+if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
+ export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
+fi