aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoviuro <moviuro+git@gmail.com>2017-11-12 15:43:26 +0100
committerMoviuro <moviuro+git@gmail.com>2017-11-12 15:46:15 +0100
commit82215fe119597a159d0141c8143aabcd1613243a (patch)
tree300dfacd5d8159b7679bfaf14da35db7e944eb5a
parent0ab35cdcdcb003a29d2488f4fda22d06e6e8a187 (diff)
downloadrofi-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-xrofi-pass11
1 files changed, 9 insertions, 2 deletions
diff --git a/rofi-pass b/rofi-pass
index a2d173c..db6aded 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -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%%: *}"