summaryrefslogtreecommitdiff
path: root/sh/pme
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2024-08-14 21:50:54 -0700
committerXiao Pan <xyz@flylightning.xyz>2024-08-14 21:50:54 -0700
commit0b66a7b7e692e8dd583eb418847c698f47f08fbc (patch)
treeba4770a8036fdf3883553b8387710d92ca4bd3a6 /sh/pme
parent0951beb37c88a50307e1e5872f80fb5bba36bd54 (diff)
my passmenu
Diffstat (limited to 'sh/pme')
-rwxr-xr-xsh/pme15
1 files changed, 15 insertions, 0 deletions
diff --git a/sh/pme b/sh/pme
new file mode 100755
index 0000000..ff6c711
--- /dev/null
+++ b/sh/pme
@@ -0,0 +1,15 @@
+#!/bin/sh
+# my Pass MEnu
+
+find "$HOME/.password-store/" \( -type f -o -type l \) -name '*.gpg' \
+ | sed "s#$HOME/\.password-store/\(.*\)\.gpg\$#\1#" \
+ | dmenu -i -p 'pass' \
+ | {
+ case "$1" in
+ # `{ IFS= read -r p; printf '%s\r' "$p";}` is modified from https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu#n34 GPL-2.0-or-later code
+ '') xargs pass | { IFS= read -r p; printf '%s\r' "$p";};;
+ '-o') xargs pass otp | tr '\n' '\r';;
+ *) exit 1;;
+ esac
+ } \
+ | xdotool type --clearmodifiers --file -