Skip to content

Commit

Permalink
Disable keyboard repeat for autopass
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fd0 committed Apr 21, 2017
1 parent 7de8480 commit e719871
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rofi-pass
Expand Up @@ -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
Expand Down Expand Up @@ -107,6 +110,10 @@ autopass () {
xdotool key Return
fi
fi

xset r "$x_repeat_enabled"
unset x_repeat_enabled

clearUp
}

Expand Down

0 comments on commit e719871

Please sign in to comment.