Skip to content

Instantly share code, notes, and snippets.

View eropple's full-sized avatar

Ed Ropple eropple

View GitHub Profile
@eropple
eropple / gpg-agent.zsh
Last active July 29, 2022 15:48 — forked from loa/README.md
Dual GPG Yubikey Setup
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
GPG_AGENT_SOCKET="$HOME/.gnupg/S.gpg-agent.ssh"
if [ ! -S $GPG_AGENT_SOCKET ]; then
gpg-agent --use-standard-socket --daemon >/dev/null 2>&1
export GPG_TTY=$(tty)