aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrofi-pass14
1 files changed, 11 insertions, 3 deletions
diff --git a/rofi-pass b/rofi-pass
index 0f3edc2..a2d173c 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -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}"