diff --git a/plugins.md b/plugins.md index fa4a59d5a16dd4e12cd6d9ece0a170d61698f023..33c504c4d96dccdff4172cd76f18274f1b58fc4d 100644 --- a/plugins.md +++ b/plugins.md @@ -217,7 +217,7 @@ Since Ion does not support autocompletion via plugins, a lot of oh-my-zsh plugin |--------------------------+--------------------------------| | golang | Planned | |--------------------------+--------------------------------| -| gpg-agent | Planned | +| gpg-agent | Done | |--------------------------+--------------------------------| | gradle | Not happening | |--------------------------+--------------------------------| diff --git a/tools/gpg-agent.ion b/tools/gpg-agent.ion new file mode 100644 index 0000000000000000000000000000000000000000..f954bbc4af25b11c827170bfd7a3cce288469755 --- /dev/null +++ b/tools/gpg-agent.ion @@ -0,0 +1,16 @@ +# Enable gpg-agent if it is not running- +# --use-standard-socket will work from version 2 upwards + +export AGENT_SOCK = $(gpgconf --list-dirs | grep agent-socket | cut -d : -f 2) + +if not test -S $AGENT_SOCK + gpg-agent --daemon --use-standard-socket &> /dev/null +end +export GPG_TTY = $(tty) + +# Set SSH to use gpg-agent if it's enabled +let GNUPGCONFIG = "$or($GNUPGHOME $HOME/.gnupg)/gpg-agent.conf" +if test -r $GNUPGCONFIG && /usr/bin/env grep -q enable-ssh-support $GNUPGCONFIG + export SSH_AUTH_SOCK = $AGENT_SOCK.ssh + export SSH_AGENT_PID = '' +end