aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/passmenu
diff options
context:
space:
mode:
Diffstat (limited to 'templates/.bin/passmenu')
-rwxr-xr-xtemplates/.bin/passmenu10
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/.bin/passmenu b/templates/.bin/passmenu
index 8284ff2..b5f431b 100755
--- a/templates/.bin/passmenu
+++ b/templates/.bin/passmenu
@@ -7,8 +7,14 @@ password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
-password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
+password=$(printf '%s\n' "${password_files[@]}" | dmenu)
[[ -n $password ]] || exit
-pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | wl-copy
+cmd=show
+
+if [ "$1" = "otp" ]; then
+ cmd=otp
+fi
+
+pass "$cmd" "$password" | { IFS= read -r pass; printf %s "$pass"; } | wl-copy