aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/ssh-askpass
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2026-04-15 12:26:57 +0100
committerJustine Smithies <justine@smithies.me.uk>2026-04-15 12:26:57 +0100
commit7131a4280fa0a8ac396373dfe6da511a16c161ff (patch)
treeb80abf9a0b13144c7f63ecca9e2e55bf161ad32f /.local/bin/ssh-askpass
parent2f469042b330b90bef91cda069cff0994d8f6e80 (diff)
Added ssh-askpass to give a pinentry-qt popup
Diffstat (limited to '.local/bin/ssh-askpass')
-rwxr-xr-x.local/bin/ssh-askpass16
1 files changed, 16 insertions, 0 deletions
diff --git a/.local/bin/ssh-askpass b/.local/bin/ssh-askpass
new file mode 100755
index 0000000..412eff0
--- /dev/null
+++ b/.local/bin/ssh-askpass
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Remember to export SSH_ASKPASS=~/.local/bin/ssh-askpass
+RESULT=$(pinentry-qt --ttytype=xterm-color --lc-ctype=en_US.UTF8 --ttyname=/dev/tty 2>/dev/null <<END | grep -E '^(D|ERR)'
+SETDESC Enter your passphrase for key:
+SETPROMPT
+GETPIN
+END
+)
+
+if [ "$RESULT" = "ERR 111 canceled" ]; then
+ exit 255
+else
+ length=$(printf "%s" "$RESULT" | wc -c)
+ length=$((length))
+ echo "$RESULT" : '..' | cut -c 3-"$length"
+fi