This repository has been archived on 2022-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/home/.config/fish/conf.d/gpg-agent.fish

27 lines
641 B
Fish

# --- Deprecated ssh-agent --- #
# ---------------------------- #
# if test -z "$XDG_RUNTIME_DIR"
# set -gx SSH_ENV $HOME/.ssh/environment
# else
# set -gx SSH_ENV $XDG_RUNTIME_DIR/ssh-agent.env
# end
#
# if not pgrep -u "$USER" ssh-agent >/dev/null
# ssh-agent -c -t 2h > "$SSH_ENV"
# chmod 600 $SSH_ENV
# end
#
# if test -z "$SSH_AUTH_SOCK"
# source "$SSH_ENV" >/dev/null
# end
if not pgrep -u "$USER" gpg-agent >/dev/null
gpg-agent --daemon --enable-ssh-support >/dev/null
end
if test -z "$SSH_AUTH_SOCK"
set -gx SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
end
gpg-connect-agent updatestartuptty /bye >/dev/null