aboutsummaryrefslogtreecommitdiffstats
path: root/pinentry-rofi.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-05-17 12:10:34 +0200
committerMatěj Cepl <mcepl@cepl.eu>2023-08-11 11:58:55 +0200
commitdf3c4ae12a602d5316d16bf331644aff842a24c2 (patch)
tree687d6e4c0ec2b750a0765fcb4b80c9e73ad94568 /pinentry-rofi.py
parent96f0ce5ccc8fdf43c3762103ce6a2379448050ed (diff)
downloadpinentry-rofi-df3c4ae12a602d5316d16bf331644aff842a24c2.tar.gz
chore: Lua and Python script created by the automated Ruby conversion.
Diffstat (limited to 'pinentry-rofi.py')
-rw-r--r--pinentry-rofi.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pinentry-rofi.py b/pinentry-rofi.py
new file mode 100644
index 0000000..3ce5556
--- /dev/null
+++ b/pinentry-rofi.py
@@ -0,0 +1,30 @@
+import subprocess
+
+rofi = ['rofi', '-dmenu', '-input', '/dev/null', '-password']
+
+def assuan_send(t):
+ print(t)
+
+assuan_send("OK Please go ahead")
+
+while True:
+ line = input()
+ ok = True
+ if line.startswith("OPTION "):
+ # OPTION grab
+ # OPTION ttyname=/dev/pts/1
+ # OPTION ttytype=tmux-256color
+ # OPTION lc-messages=C
+ # OPTI
+ pass
+ elif line == "BYE":
+ break
+ else:
+ rofi.append(line.strip())
+ ok = False
+
+ if ok:
+ break
+
+password = subprocess.check_output(rofi).decode().strip()
+assuan_send(password)