Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # custom version: can match user
- shopt -s nullglob globstar
- if [[ $1 == "--user" ]]; then
- grepstr='(?<=user: ).*$'
- shift
- fi
- 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[@]}" | rofi -p 'pass ' -dmenu "$@")
- [[ -n "$password" ]] || exit
- pass show "$password" |
- (([ -z "$grepstr" ] && cat) || grep -oP "$grepstr" ) | # lol
- awk 'BEGIN{ORS=""} {print; exit}' |
- xdotool type --clearmodifiers --file -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement