[zsh] Save SSH-agent in var

This commit is contained in:
murgi
2023-10-31 12:34:17 +01:00
parent f8de99b825
commit 1b9e0c1a82
3 changed files with 10 additions and 1 deletions

View File

@@ -11,3 +11,7 @@ for filename in .config/*; do
done
ln -Ts $PWD/nvim $HOME/.config/nvim
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
cat $PWD/ssh_config >> $HOME/.ssh/config

3
ssh_config Normal file
View File

@@ -0,0 +1,3 @@
Host *
IdentityAgent $SSH_REAL_SOCK
AddKeysToAgent yes

View File

@@ -1,5 +1,5 @@
export PATH="$HOME/.local/bin:$PATH"
+[[ -z $SSH_AUTH_SOCK ]] || export FORWARD_SOCK=$SSH_AUTH_SOCK
[[ -z $SSH_AUTH_SOCK ]] || export FORWARD_SOCK=$SSH_AUTH_SOCK
[[ -f ~/.zsh/.powerline_config ]] && source ~/.zsh/.powerline_config
[[ -f ~/.zsh/.user_config ]] && source ~/.zsh/.user_config
@@ -19,6 +19,8 @@ fi
# source antidote and load plugins from `${ZDOTDIR:-~}/.zsh_plugins.txt`
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
antidote load ${plugins_txt} ${static_file}
export SSH_REAL_SOCK=$SSH_AUTH_SOCK
[[ -z $FORWARD_SOCK ]] || export SSH_AUTH_SOCK=$FORWARD_SOCK
setopt interactivecomments
setopt HIST_IGNORE_SPACE