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

11
bin/ssh-askpass-rofi Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
arg="$*"
key="$(echo "${arg}" | perl -ne "/'(.*)'/"' and print "$1\n"')"
pub="${key}.pub"
fingerprint="$(ssh-keygen -l -v -f "${pub}")"
mesg="${arg}
${fingerprint}
"
rofi -dmenu -disable-history -no-fixed-num-lines -l 1 -i -input /dev/null -password -p 'Passphrase' -mesg "${mesg}"