summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--zprofile26
-rwxr-xr-xzshrc2
2 files changed, 23 insertions, 5 deletions
diff --git a/zprofile b/zprofile
index 44b47c4..f0ceafa 100644
--- a/zprofile
+++ b/zprofile
@@ -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
diff --git a/zshrc b/zshrc
index 39f137f..af04355 100755
--- a/zshrc
+++ b/zshrc
@@ -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