forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sorin-ionescu#118 from fwalch/gpg-agent
Added gpg-agent plugin
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Based on ssh-agent code | ||
|
||
local GPG_ENV=$HOME/.gnupg/gpg-agent.env | ||
|
||
function start_agent { | ||
/usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null | ||
chmod 600 ${GPG_ENV} | ||
. ${GPG_ENV} > /dev/null | ||
} | ||
|
||
# Source GPG agent settings, if applicable | ||
if [ -f "${GPG_ENV}" ]; then | ||
. ${GPG_ENV} > /dev/null | ||
ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || { | ||
start_agent; | ||
} | ||
else | ||
start_agent; | ||
fi | ||
|
||
export GPG_AGENT_INFO | ||
export SSH_AUTH_SOCK | ||
export SSH_AGENT_PID | ||
|
||
GPG_TTY=$(tty) | ||
export GPG_TTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | ||
|
||
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |