From d590838761428a514d8bfdb97ef894c3399f10ee Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sun, 15 Mar 2026 08:54:49 +0100 Subject: [PATCH] add sshs back --- config/shell/.config/fish/conf.d/10-sshs.fish | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 config/shell/.config/fish/conf.d/10-sshs.fish diff --git a/config/shell/.config/fish/conf.d/10-sshs.fish b/config/shell/.config/fish/conf.d/10-sshs.fish new file mode 100644 index 0000000..0cd1220 --- /dev/null +++ b/config/shell/.config/fish/conf.d/10-sshs.fish @@ -0,0 +1,18 @@ +# ssh with encrypted private keys +# $ssh_keys should be set in advance or left empty to use the default keys + +if set -q ENABLE_GPG_AGENT_SSH; and test $ENABLE_GPG_AGENT_SSH != "0";\ + and type -q gpg-init; and type -q gpgconf + + true # do nothing + +else if type -q ssh-init; and type -q ssh-add + # avoid entering passphrase every time + function sshs + # test if keys are added to ssh-agent + if not ssh-add -l > /dev/null 2>&1 + ssh-add $ssh_keys + end + ssh $argv + end +end