Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
571 B

  1. #!/usr/bin/env bash
  2. shopt -s nullglob globstar
  3. typeit=0
  4. if [[ $1 == "--type" ]]; then
  5. typeit=1
  6. shift
  7. fi
  8. prefix=${PASSWORD_STORE_DIR-~/.password-store}
  9. password_files=( "$prefix"/**/*.gpg )
  10. password_files=( "${password_files[@]#"$prefix"/}" )
  11. password_files=( "${password_files[@]%.gpg}" )
  12. password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
  13. [[ -n $password ]] || exit
  14. if [[ $typeit -eq 0 ]]; then
  15. pass show -c "$password" 2>/dev/null
  16. else
  17. pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
  18. xdotool type --clearmodifiers --file -
  19. fi