summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2025-03-11 11:43:02 -0500
committerMatt Strapp <matt@mattstrapp.net>2025-03-11 11:43:13 -0500
commit08a01af32e49dd1c1e1087d9f3910137ee4e2c35 (patch)
treec93e636b5e8c0a617ff405fcbd151b8046ccf6a1
parentUpdate htop (diff)
downloaddotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.tar
dotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.tar.gz
dotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.tar.bz2
dotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.tar.lz
dotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.tar.xz
dotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.tar.zst
dotfiles-08a01af32e49dd1c1e1087d9f3910137ee4e2c35.zip
Make sure ssh-agent runs
-rw-r--r--dot_config/zsh/dot_zshrc10
1 files changed, 9 insertions, 1 deletions
diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc
index 350571a..036bfac 100644
--- a/dot_config/zsh/dot_zshrc
+++ b/dot_config/zsh/dot_zshrc
@@ -33,6 +33,14 @@ if [ -x "$(command -v gem)" ]; then
export PATH="$PATH:$GEM_HOME/bin"
fi
+# Make sure ssh-agent runs
+if ! pgrep -u "$USER" ssh-agent > /dev/null; then
+ ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
+fi
+if [ ! -f "$SSH_AUTH_SOCK" ]; then
+ source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
+fi
+
# Enable colors and change prompt:
autoload -U colors && colors # Load colors
#stty stop undef # Disable ctrl-s to freeze terminal.
@@ -92,4 +100,4 @@ PS1="\[\033]133;D;\007\]\[\033]133;A;\007\]$PS1\[\033]133;B;\007\]"
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/. p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
-[[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh \ No newline at end of file
+[[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh