Skip to content

Instantly share code, notes, and snippets.

@5thWall
Created February 11, 2016 05:48
Show Gist options
  • Save 5thWall/97db8e5f1c63de8041d5 to your computer and use it in GitHub Desktop.
Save 5thWall/97db8e5f1c63de8041d5 to your computer and use it in GitHub Desktop.
Configure gpg-agent on a mac.
<!--
Place in $HOME/Library/LaunchAgents/gpg-agent.plist
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>gpg-agent</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/gpg-agent</string>
<string>--daemon</string>
<string>--enable-ssh-support</string>
<string>--write-env-file</string>
<string>/Users/5thWall/.gpg-agent-info</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
# Add to your .[bash|zsh]rc
if [[ $(uname) == Darwin ]]; then
if [ -f "${HOME}/.gpg-agent-info" ]; then
. "${HOME}/.gpg-agent-info"
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment