diff options
-rwxr-xr-x | passmenu.sh | 16 |
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 | ||
3 | shopt -s nullglob globstar | 3 | shopt -s nullglob globstar |
4 | 4 | ||
5 | typeit=0 | ||
6 | if [[ $1 == "--type" ]]; then | ||
7 | typeit=1 | ||
8 | shift | ||
9 | fi | ||
10 | |||
11 | prefix=${PASSWORD_STORE_DIR-~/.password-store} | 5 | prefix=${PASSWORD_STORE_DIR-~/.password-store} |
12 | password_files=( "$prefix"/**/*.gpg ) | 6 | password_files=( "$prefix"/**/*.gpg ) |
13 | password_files=( "${password_files[@]#"$prefix"/}" ) | 7 | password_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 | ||
20 | if [[ $typeit -eq 0 ]]; then | 14 | output=`pass show "$password"` |
21 | pass show -c "$password" 2>/dev/null | 15 | echo "$output" | sed -n '2p' | xclip -selection clipboard |
22 | else | 16 | echo "$output" | sed -n '1p' | xclip -selection primary -loop 1 -verbose |
23 | pass show "$password" | { read -r pass; printf %s "$pass"; } | | 17 | echo '' | xclip -selection clipboard |
24 | xdotool type --clearmodifiers --file - | ||
25 | fi | ||
26 | 18 | ||