aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/ssh-askpass.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2026-01-24 17:24:58 +0000
committerJustine Smithies <justine@smithies.me.uk>2026-01-24 17:24:58 +0000
commit1d6a548bcbe85ee95e986c475b23733c2977bf04 (patch)
tree7605c43bf5b4f4044a606c6b404ab9d71cd55ddc /.local/bin/ssh-askpass.sh
parent818cb6579e422a03da5564ef93715f43f969954c (diff)
Initial commit
Diffstat (limited to '.local/bin/ssh-askpass.sh')
-rwxr-xr-x.local/bin/ssh-askpass.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/.local/bin/ssh-askpass.sh b/.local/bin/ssh-askpass.sh
new file mode 100755
index 0000000..234457a
--- /dev/null
+++ b/.local/bin/ssh-askpass.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Remember to export SSH_ASKPASS=~/.local/bin/ssh-askpass.sh
+RESULT=$(pinentry-qt --ttytype=xterm-color --lc-ctype=en_US.UTF8 --ttyname=/dev/tty <<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