]> arthur.barton.de Git - ax-zsh.git/blob - plugins/gnupg/gnupg.zshrc
gnupg: Don't fiddle with gpg-agent that much
[ax-zsh.git] / plugins / gnupg / gnupg.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # gnupg.zshrc: Setup GnuPG
3
4 if (( $+commands[gpg2] )); then
5         # Use the gpg completions for gpg2, too
6         compdef gpg2=gpg
7
8         if ! (( $+commands[gpg])); then
9                 # gpg2 is available, but no gpg: alias it!
10                 alias gpg="gpg2"
11         fi
12 else
13         # Make sure that "gpg(1)" is available.
14         (( $+commands[gpg] )) || return 1
15 fi
16
17 export GPG_TTY=$(tty)
18
19 if (( $+commands[gpg-connect-agent] )); then
20         # Try to start/connect the agent ...
21         gpg-connect-agent /bye
22 fi