Created
November 27, 2021 15:25
-
-
Save kiwimato/eadc7d3f6e47f9a69e3f5bf882939f1c to your computer and use it in GitHub Desktop.
.xsession gpg-agent SSH_AGENT SSH_AUTH_SOCK Yubikey Jetbrains Pycharm IntelliJ IDEA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AGENT_SOCK=$(gpgconf --list-dirs | grep agent-socket | cut -d : -f 2) | |
if [[ ! -S $AGENT_SOCK ]]; then | |
gpg-agent --daemon --use-standard-socket &>/dev/null | |
fi | |
export GPG_TTY=$TTY | |
# Set SSH to use gpg-agent if it's enabled | |
GNUPGCONFIG="${GNUPGHOME:-"$HOME/.gnupg"}/gpg-agent.conf" | |
if [[ -r $GNUPGCONFIG ]] && command grep -q enable-ssh-support "$GNUPGCONFIG"; then | |
export SSH_AUTH_SOCK="$AGENT_SOCK.ssh" | |
unset SSH_AGENT_PID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment