From e719871bf760cba98195d2f02a95cee39f8e21f2 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 21 Apr 2017 09:24:01 +0200 Subject: Disable keyboard repeat for autopass This commit disables keyboard auto repeat during automatic password entry with xdotool, and reenables auto repeat afterwards only if it was enabled before. This procedure reduces accidentally repeated keys a lot. Closes #67 --- rofi-pass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rofi-pass b/rofi-pass index 59172f8..0900477 100755 --- a/rofi-pass +++ b/rofi-pass @@ -75,6 +75,9 @@ checkIfPass () { autopass () { + x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}') + xset r off + rm -f "$HOME/.cache/rofi-pass/last_used" echo "${root}: $selected_password" > "$HOME/.cache/rofi-pass/last_used" if [[ -z "${stuff["$AUTOTYPE_field"]}" ]]; then @@ -107,6 +110,10 @@ autopass () { xdotool key Return fi fi + + xset r "$x_repeat_enabled" + unset x_repeat_enabled + clearUp } -- cgit