diff options
-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}" |