Browse Source

set SSH_AUTH_SOCK for gpg-agent

Fabian Peter Hammerle 5 years ago
parent
commit
b65191a483
1 changed files with 5 additions and 0 deletions
  1. 5 0
      rc.xsh

+ 5 - 0
rc.xsh

@@ -28,10 +28,15 @@ import datetime as dt
 import dateutil.tz
 import os
 import re
+import shutil
 
 $EDITOR = 'vim'
 # required by pinentry-tty when using gpg command:
 $GPG_TTY = $(tty)
+if shutil.which('gpgconf'):
+    if not 'SSH_CLIENT' in ${...}:
+        # in gnupg 2.1.13 the location of agents socket changed
+        $SSH_AUTH_SOCK=$(gpgconf --list-dir agent-ssh-socket).rstrip()
 # wrapper for termite required when launching termite from ranger:
 $TERMCMD = os.path.join(os.path.dirname(__file__), 'ranger-termite-termcmd')