diff options
author | Moviuro <moviuro+git@gmail.com> | 2017-11-12 15:28:36 +0100 |
---|---|---|
committer | Moviuro <moviuro+git@gmail.com> | 2017-11-12 15:46:10 +0100 |
commit | 0ab35cdcdcb003a29d2488f4fda22d06e6e8a187 (patch) | |
tree | bb6751f41e09f5456a1146da80c5c7bb880b3783 | |
parent | 5e71e31bde7eba44b411c2122a3e420f15398f24 (diff) | |
download | rofi-pass-0ab35cdcdcb003a29d2488f4fda22d06e6e8a187.tar.gz |
rofi-pass: first integration of pass-otp(1)
-rwxr-xr-x | rofi-pass | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -318,14 +318,22 @@ mainMenu () { mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass "${pass_file}") password=${password_temp[0]} fi - fields=$(printf '%s\n' "${password_temp[@]:1}" | awk '$1 ~ /:$/{$1=$1;print}') + fields=$(printf '%s\n' "${password_temp[@]:1}" | awk '$1 ~ /:$/ || /otpauth:\/\// {$1=$1;print}') declare -A stuff stuff["pass"]=${password} if [[ -n $fields ]]; then while read -r LINE; do - _id="${LINE%%: *}" - _val="${LINE#* }" + case "$LINE" in + "otpauth://"*) + _id="OTP" + _val="$(PASSWORD_STORE_DIR="${root}" pass otp "$selected_password")" + ;; + *) + _id="${LINE%%: *}" + _val="${LINE#* }" + ;; + esac stuff["${_id}"]=${_val} done < <(printf '%s\n' "${fields}") if test "${stuff['autotype']+autotype}" |