aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-09-30 16:22:25 +0100
committerMatthew Lemon <y@yulqen.org>2023-09-30 16:22:25 +0100
commitfa940542283f7ee296ea62aa6132d5d52499f828 (patch)
tree68da927fa3b068bce0f838642d3da8cf351805f0
parent2dfae1a24a2dd780fbddbfdaf995696a4a97eee7 (diff)
Switches off gpg agent for ssh and uses ssh agent
-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';