m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/contrib/dmenu/passmenu
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-23 22:22:38 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-23 22:22:38 +0200
commit95d100938736d074a404a5f4d4ef1a38ceaab515 (patch)
treeee61b7ca8120e9c172da541d7bbbce0c2b99b33a /contrib/dmenu/passmenu
parent47a1f0897313bbde85051e939af0fc8220feb175 (diff)
contrib: import passmenu
Diffstat (limited to 'contrib/dmenu/passmenu')
-rwxr-xr-xcontrib/dmenu/passmenu12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu
new file mode 100755
index 0000000..5d9d454
--- /dev/null
+++ b/contrib/dmenu/passmenu
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+shopt -s nullglob globstar
+
+prefix=${PASSWORD_STORE_DIR-~/.password-store}
+password_files=( "$prefix"/**/*.gpg )
+password_files=( "${password_files[@]#"$prefix"/}" )
+password_files=( "${password_files[@]%.gpg}" )
+
+password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
+
+[ $? -eq 0 ] && pass -c "$password"