summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpassmenu.sh16
1 files changed, 4 insertions, 12 deletions
diff --git a/passmenu.sh b/passmenu.sh
index 6566ef4..3ac2e4e 100755
--- a/passmenu.sh
+++ b/passmenu.sh
@@ -2,12 +2,6 @@
2 2
3shopt -s nullglob globstar 3shopt -s nullglob globstar
4 4
5typeit=0
6if [[ $1 == "--type" ]]; then
7 typeit=1
8 shift
9fi
10
11prefix=${PASSWORD_STORE_DIR-~/.password-store} 5prefix=${PASSWORD_STORE_DIR-~/.password-store}
12password_files=( "$prefix"/**/*.gpg ) 6password_files=( "$prefix"/**/*.gpg )
13password_files=( "${password_files[@]#"$prefix"/}" ) 7password_files=( "${password_files[@]#"$prefix"/}" )
@@ -17,10 +11,8 @@ password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
17 11
18[[ -n $password ]] || exit 12[[ -n $password ]] || exit
19 13
20if [[ $typeit -eq 0 ]]; then 14output=`pass show "$password"`
21 pass show -c "$password" 2>/dev/null 15echo "$output" | sed -n '2p' | xclip -selection clipboard
22else 16echo "$output" | sed -n '1p' | xclip -selection primary -loop 1 -verbose
23 pass show "$password" | { read -r pass; printf %s "$pass"; } | 17echo '' | xclip -selection clipboard
24 xdotool type --clearmodifiers --file -
25fi
26 18