diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2016-01-09 00:06:41 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-05 00:18:32 +0200 |
commit | 7a0417d1efd79710049f694372bc7458789d0946 (patch) | |
tree | 3c42a9534403bc4b33518a620222b2f5f09e0d86 | |
parent | 3a3d28b0b5aa7d6bcff2501126f1922b61f06b01 (diff) | |
download | pass-7a0417d1efd79710049f694372bc7458789d0946.tar.gz pass-7a0417d1efd79710049f694372bc7458789d0946.tar.bz2 pass-7a0417d1efd79710049f694372bc7458789d0946.zip |
Add --user option to passmenu
Diffstat (limited to '')
-rwxr-xr-x | contrib/dmenu/passmenu | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu index 83268bc..d371ea9 100755 --- a/contrib/dmenu/passmenu +++ b/contrib/dmenu/passmenu @@ -8,6 +8,12 @@ if [[ $1 == "--type" ]]; then shift fi +user= +if [[ $1 == "--user" ]]; then + user=-u + shift +fi + prefix=${PASSWORD_STORE_DIR-~/.password-store} password_files=( "$prefix"/**/*.gpg ) password_files=( "${password_files[@]#"$prefix"/}" ) @@ -18,8 +24,8 @@ password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") [[ -n $password ]] || exit if [[ $typeit -eq 0 ]]; then - pass show -c "$password" 2>/dev/null + pass show $user -c "$password" 2>/dev/null else - pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | + pass show $user "$password" | { IFS= read -r pass; printf %s "$pass"; } | xdotool type --clearmodifiers --file - fi |