Commit 2a77261c authored by Guilherme Semente's avatar Guilherme Semente 🌱

Enable SSH support on gpg-agent

parent 643ce346
# Disabled. I'm currently using GNOME Keyring for SSH
#enable-ssh-support
enable-ssh-support
# do not grab the keyboard
#no-grab
......
......@@ -21,27 +21,39 @@ PATH="$HOME/bin:$HOME/.local/bin:$PATH:/usr/local/games:/usr/games:/usr/local/sb
export PATH="$HOME/.cargo/bin:$PATH"
# golang
export PATH="$HOME/.go/bin:$PATH"
export GOPATH="$HOME/.go"
export GOPATH="$HOME/src/go"
export PATH="$GOPATH/bin:$PATH"
# cp, ln, ...
#export VERSION_CONTROL=numbered
export VERSION_CONTROL=numbered
_gpg_tty () {
# link gpg-agent to the connected terminal (manpage gpg-agent(1))
# link gpg-agent to the connected terminal (manpage gpg-agent(1))
_set_gpg_tty () {
GPG_TTY=$(tty)
export GPG_TTY
}
# if enable-ssh-support is set in your gpg-agent.conf, you also need to tell ssh
# to use gpg-agent
_set_ssh_agent () {
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK
fi
}
# if running BASH
if [ -n "$BASH_VERSION" ]; then
_gpg_tty
_set_gpg_tty
_set_ssh_agent
[ -f ~/.bashrc ] && . ~/.bashrc
fi
# if running zsh
if [ -n "$ZSH_VERSION" ]; then
_gpg_tty
_set_gpg_tty
_set_ssh_agent
# Zsh reads ~/.zshrc in all interactive shells, whether they
# are login shells or not, we don't need load ~/.zshrc here
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment