From fe5c3dab744348b4c11fd8d56c67da8867a9df80 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 2 Jan 2020 16:45:06 +0100 Subject: {zsh] better ssh-agent handling & fzf --- zsh/.zshrc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 5a9bf69..2b34035 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -93,12 +93,20 @@ export WORKON_HOME="~/Code/PyEnvs" export EDITOR="vim" export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" -#if [[ "$SSH_AGENT_PID" == "" ]]; then -# eval $(<~/.ssh-agent-thing) -#fi +if [ -f ~/.ssh/agent.env ] ; then + . ~/.ssh/agent.env > /dev/null + if ! kill -0 $SSH_AGENT_PID > /dev/null 2>&1; then + echo "Stale agent file found. Spawning new agent… " + eval `ssh-agent | tee ~/.ssh/agent.env` + #ssh-add + fi +else + echo "Starting ssh-agent" + eval `ssh-agent | tee ~/.ssh/agent.env` + #ssh-add +fi source /usr/bin/virtualenvwrapper.sh source /home/daniel/.profile -# added by travis gem -[ -f /home/daniel/.travis/travis.sh ] && source /home/daniel/.travis/travis.sh +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -- cgit v1.2.3