aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2018-08-12 12:16:56 +0200
committerGitHub <noreply@github.com>2018-08-12 12:16:56 +0200
commit5dbb7f56e03aac419d0f404e3454f03c107dd036 (patch)
treeee01e6683fe32a5884aebd51d4ac1f22a8c8d6f3
parente52064ad848b6efbed71d14c1b22f3d176fe3e5a (diff)
parent866694f2d494fc9a0a93d8c030c0fbe3e0536136 (diff)
downloadrofi-pass-5dbb7f56e03aac419d0f404e3454f03c107dd036.tar.gz
Merge pull request #143 from steinex/master
when typing, make delay between keypresses configurable
-rw-r--r--config.example3
-rwxr-xr-xrofi-pass13
2 files changed, 10 insertions, 6 deletions
diff --git a/config.example b/config.example
index f364472..2aba361 100644
--- a/config.example
+++ b/config.example
@@ -37,6 +37,9 @@ delay=2
# rofi-pass needs to close itself before it can type passwords. Set delay here.
wait=0.2
+# delay between keypresses when typing (in ms)
+xdotool_delay=12
+
## Programs to be used
# Editor
EDITOR='gvim -f'
diff --git a/rofi-pass b/rofi-pass
index beabb69..7411998 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -22,6 +22,7 @@ OTPmethod_field='otp_method'
default_autotype="user :tab pass"
delay=2
wait=0.2
+xdotool_delay=12
default_do='menu' # menu, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='false'
notify='false'
@@ -91,9 +92,9 @@ autopass () {
":space") xdotool key space;;
":delay") sleep "${delay}";;
":enter") xdotool key Return;;
- ":otp") printf '%s' "$(generateOTP)" | xdotool type --clearmodifiers --file -;;
- "pass") printf '%s' "${password}" | xdotool type --clearmodifiers --file -;;
- *) printf '%s' "${stuff[${word}]}" | xdotool type --clearmodifiers --file -;;
+ ":otp") printf '%s' "$(generateOTP)" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -;;
+ "pass") printf '%s' "${password}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -;;
+ *) printf '%s' "${stuff[${word}]}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -;;
esac
done
@@ -145,7 +146,7 @@ typeUser () {
x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
xset r off
- printf '%s' "${stuff[${USERNAME_field}]}" | xdotool type --clearmodifiers --file -
+ printf '%s' "${stuff[${USERNAME_field}]}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -
xset r "$x_repeat_enabled"
unset x_repeat_enabled
@@ -159,7 +160,7 @@ typePass () {
x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
xset r off
- printf '%s' "${password}" | xdotool type --clearmodifiers --file -
+ printf '%s' "${password}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -
if [[ $notify == "true" ]]; then
if [[ "${stuff[notify]}" == "false" ]]; then
@@ -192,7 +193,7 @@ typeField () {
*) to_type="${stuff[${typefield}]}" ;;
esac
- printf '%s' "$to_type" | xdotool type --clearmodifiers --file -
+ printf '%s' "$to_type" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -
xset r "$x_repeat_enabled"
unset x_repeat_enabled