diff options
-rw-r--r-- | zprofile | 26 | ||||
-rwxr-xr-x | zshrc | 2 |
2 files changed, 23 insertions, 5 deletions
@@ -1,4 +1,22 @@ -source $ZSH_BASE/antigen/antigen.zsh -antigen use oh-my-zsh -antigen bundle ssh-agent -antigen apply
\ No newline at end of file +SSH_ENV="$HOME/.ssh/agent-environment" + +function start_agent { + echo "Initialising new SSH agent..." + /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" + echo succeeded + chmod 600 "${SSH_ENV}" + . "${SSH_ENV}" > /dev/null + /usr/bin/ssh-add; +} + +# Source SSH settings, if applicable + +if [ -f "${SSH_ENV}" ]; then + . "${SSH_ENV}" > /dev/null + #ps ${SSH_AGENT_PID} doesn't work under cywgin + ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + start_agent; + } +else + start_agent; +fi
\ No newline at end of file @@ -13,6 +13,7 @@ hash -d d=${HOME}/docker [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] && source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +source $ZSH_BASE/zprofile source $ZSH_BASE/antigen/antigen.zsh source $ZSH_BASE/zsh/setopt.zsh source $ZSH_BASE/zsh/prompt.zsh @@ -22,7 +23,6 @@ source $ZSH_BASE/zsh/keybindings.zsh antigen use oh-my-zsh antigen bundle git -antigen bundle ssh-agent antigen bundle fzf antigen bundle dotnet antigen bundle docker |