Use rofi for SSH passphrases

This commit is contained in:
Loic Nageleisen 2024-03-19 14:57:55 +01:00
parent e646389fab
commit bb8b9420d6
Signed by: lloeki
GPG key ID: D05DAEE6889F94C2
3 changed files with 32 additions and 1 deletions

View file

@ -14,7 +14,7 @@ fi
# autoload keys if there's an agent
if [[ -n "${SSH_AUTH_SOCK}" ]]; then
if ! ssh-add -l > /dev/null; then
if ! command ssh-add -l > /dev/null; then
case "${OSTYPE}" in
linux*)
# TODO: unsure yet
@ -33,6 +33,25 @@ if [[ -n "${SSH_AUTH_SOCK}" ]]; then
;;
esac
fi
case "${OSTYPE}" in
linux*)
SSH_ASKPASS="${DOTFILES_BIN_DIR}/ssh-askpass-rofi"
SSH_ASKPASS_REQUIRE='prefer'
export SSH_ASKPASS SSH_ASKPASS_REQUIRE
;;
*)
:
;;
esac
fi
function ssh-add() {
if [[ $# -eq 0 ]]; then
command ssh-add ~/.ssh/id_*[!.pub]
else
command ssh-add "$@"
fi
}
# vim: ft=bash