123456789101112131415161718 |
- #!/usr/bin/env bash
- # This script requires Ruby, ROTP (Rubygems), totp (https://github.com/hobarrera/totp-cli), pass (http://passwordstore.org) and dmenu (suckless).
- shopt -s nullglob globstar
- typeit=0
- if [[ $1 == "--type" ]]; then
- typeit=1
- shift
- fi
- ## This is now dynamic, hahahahahahaha.
- PASSLIST=(`ls $HOME/.password-store/2fa/`)
- password=$(printf '%s\n' "${PASSLIST[@]}" | dmenu "$@")
- [[ -n $password ]] || exit
- if [[ $typeit -eq 0 ]]; then
- /usr/bin/env totp $password | xsel
- else
- echo "Unknown password entry, please enter a valid entry."
- fi
|