Browse code

Merge pull request #118 from fwalch/gpg-agent

Added gpg-agent plugin

Robby Russell authored on 26/05/2011 at 07:59:25
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# Based on ssh-agent code
1
+
2
+local GPG_ENV=$HOME/.gnupg/gpg-agent.env
3
+
4
+function start_agent {
5
+  /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null
6
+  chmod 600 ${GPG_ENV}
7
+  . ${GPG_ENV} > /dev/null
8
+}
9
+
10
+# Source GPG agent settings, if applicable
11
+if [ -f "${GPG_ENV}" ]; then
12
+  . ${GPG_ENV} > /dev/null
13
+  ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || {
14
+    start_agent;
15
+  }
16
+else
17
+  start_agent;
18
+fi
19
+
20
+export GPG_AGENT_INFO
21
+export SSH_AUTH_SOCK
22
+export SSH_AGENT_PID
23
+
24
+GPG_TTY=$(tty)
25
+export GPG_TTY
0 26
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
3
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
4
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
5
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"