zshrc: Work around gnupg agent path on Fedora
Fedora seems to put it in $XDG_RUNTIME_DIR/gnupg/<random string>. Check if $XDG_RUNTIME_DIR/gnupg exists and pick the first socket we find in there (there should only be one).
This commit is contained in:
parent
37fc52078c
commit
e36d1afffa
1 changed files with 10 additions and 3 deletions
13
zshrc
13
zshrc
|
@ -345,9 +345,16 @@ __has_command url2pkg &&
|
||||||
__has_command mpv && alias mpv="LC_ALL=C mpv"
|
__has_command mpv && alias mpv="LC_ALL=C mpv"
|
||||||
|
|
||||||
if __has_command gpg gpg2; then
|
if __has_command gpg gpg2; then
|
||||||
alias gssh="SSH_AUTH_SOCK=$GNUPGHOME/S.gpg-agent.ssh ssh"
|
local sock
|
||||||
alias gssh-add="SSH_AUTH_SOCK=$GNUPGHOME/S.gpg-agent.ssh ssh-add"
|
if [ -d "$XDG_RUNTIME_DIR/gnupg" ]; then
|
||||||
alias gsftp="SSH_AUTH_SOCK=$GNUPGHOME/S.gpg-agent.ssh sftp"
|
sock=$(find $XDG_RUNTIME_DIR/gnupg -name S.gpg-agent.ssh |
|
||||||
|
head -1)
|
||||||
|
fi
|
||||||
|
[ -n "$sock" ] || sock="$GNUPGHOME/S.gpg-agent.ssh"
|
||||||
|
|
||||||
|
alias gssh="SSH_AUTH_SOCK=$sock ssh"
|
||||||
|
alias gssh-add="SSH_AUTH_SOCK=$sock ssh-add"
|
||||||
|
alias gsftp="SSH_AUTH_SOCK=$sock sftp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if __has_command cryptopassphrase; then
|
if __has_command cryptopassphrase; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue