diff options
author | Moviuro <moviuro+git@gmail.com> | 2017-11-12 15:43:26 +0100 |
---|---|---|
committer | Moviuro <moviuro+git@gmail.com> | 2017-11-12 15:46:15 +0100 |
commit | 82215fe119597a159d0141c8143aabcd1613243a (patch) | |
tree | 300dfacd5d8159b7679bfaf14da35db7e944eb5a | |
parent | 0ab35cdcdcb003a29d2488f4fda22d06e6e8a187 (diff) | |
download | rofi-pass-82215fe119597a159d0141c8143aabcd1613243a.tar.gz |
rofi-pass: now, we only use pass-otp(1) when we type the OTP
This prevents:
* increasing the counter for HOTP
* generating a TOTP too far in the past
-rwxr-xr-x | rofi-pass | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -143,14 +143,21 @@ typePass () { typeField () { checkIfPass + local to_type x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}') xset r off - printf '%s' "${stuff[${typefield}]}" | xdotool type --clearmodifiers --file - + case $typefield in + "OTP") to_type="$(PASSWORD_STORE_DIR="${root}" pass otp "$selected_password")" ;; + *) to_type="${stuff[${typefield}]}" ;; + esac + + printf '%s' "$to_type" | xdotool type --clearmodifiers --file - xset r "$x_repeat_enabled" unset x_repeat_enabled + unset to_type clearUp } @@ -327,7 +334,7 @@ mainMenu () { case "$LINE" in "otpauth://"*) _id="OTP" - _val="$(PASSWORD_STORE_DIR="${root}" pass otp "$selected_password")" + _val="" ;; *) _id="${LINE%%: *}" |