aboutsummaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc9
1 files changed, 8 insertions, 1 deletions
diff --git a/bashrc b/bashrc
index de9c986..bba3c68 100644
--- a/bashrc
+++ b/bashrc
@@ -88,9 +88,16 @@ source /usr/share/fzf/completion.bash
# gpg
export GPG_TTY="$(tty)"
-export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
gpgconf --launch gpg-agent
+# ssh - from https://wiki.archlinux.org/title/SSH_keys#SSH_agents
+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
+
# bind '"\C-r": "\C-x1\e^\er"'
# bind -x '"\C-x1": __fzf_history';