all repos — archive/dotfiles @ 49a5ac56ccf6bea186dcf0bfccb32bb82b05a772

Superseded by nixfiles

Fix setting SSH_AUTH_SOCK
Alan Pearce alan@alanpearce.uk
Tue, 28 Feb 2017 14:58:09 +0100
commit

49a5ac56ccf6bea186dcf0bfccb32bb82b05a772

parent

21d5403fe6d5d0c6d51cda1d6080a62496e9b243

2 files changed, 2 insertions(+), 2 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -677,7 +677,7 @@ (use-package tramp   :defer 7
   :config (progn
             (unless (getenv "SSH_AUTH_SOCK")
-              (setenv "SSH_AUTH_SOCK" "/run/user/1000/ssh-agent.socket"))
+              (setenv "SSH_AUTH_SOCK" (format "/run/user/%s/ssh-agent" (user-uid))))
             (setq tramp-default-method "ssh"
                   tramp-default-user-alist '(("\\`su\\(do\\)?\\'" nil "root"))
                   tramp-backup-directory-alist backup-directory-alist
M tag-zsh/config/zsh/zshenvtag-zsh/config/zsh/zshenv
@@ -14,7 +14,7 @@ ZPLUG_HOME=${ZPLUG_HOME:-~/projects/zplug} 
   if [[ -z $SSH_AUTH_SOCK ]]
   then
-    export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
+    export SSH_AUTH_SOCK=${XDG_RUNTIME_DIR:-/run/user/$UID}/ssh-agent
   fi
 
   case $OSTYPE in