dmenu_pass.sh 613 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. # Original script: https://efe.kim/files/scripts/dmenu_pass
  3. # Since I use otp I needed to add the check if the line ends with -otp
  4. # I set up pws like this: site/user, site/user-otp, site/user-otp-recovery
  5. # I needed the directories. I'm bad with regex so if you know a shorer
  6. # one for this(delete everything except dirs in the ~/.password-store dir)
  7. # let me know :D
  8. password=$(find ~/.password-store/ -type f -name '*.gpg' |
  9. sed 's/.*\/\.password-store\/\(.*\)\.gpg$/\1/' |
  10. dmenu -i)
  11. case $password in
  12. *-otp) pass otp show -c "$password" ;;
  13. *) pass show -c "$password" ;;
  14. esac