Skip to content

Commit

Permalink
make delay configurable and make sure it is always used. fixes and en…
Browse files Browse the repository at this point in the history
…hances #88
  • Loading branch information
carnager committed Oct 3, 2017
1 parent 6d469c5 commit 3929c96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions config.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ AUTOTYPE_field='autotype'
# delay to be used for :delay keyword
delay=2

# rofi-pass needs to close itself before it can type passwords. Set delay here.
wait=0.2

## Programs to be used
# Editor
EDITOR='gvim -f'
Expand Down
15 changes: 8 additions & 7 deletions rofi-pass
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AUTOTYPE_field='autotype'

default_autotype="user :tab pass"
delay=2
wait=0.2
default_do='menu' # menu, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='false'
notify='false'
Expand Down Expand Up @@ -341,9 +342,9 @@ Run ${default_do} with <span color='$help_color'>Enter</span>. For more help hit
# actions based on keypresses
case "${rofi_exit}" in
0) typeMenu;;
10) sleep 0.2; autopass;;
11) sleep 0.2; typeUser;;
12) sleep 0.2; typePass;;
10) sleep $wait; autopass;;
11) sleep $wait; typeUser;;
12) sleep $wait; typePass;;
13) openURL;;
14) copyMenu;;
15) copyPass;;
Expand Down Expand Up @@ -402,13 +403,13 @@ typeMenu () {
fi
case "$typefield" in
"") exit;;
"password") typePass;;
"${AUTOTYPE_field}") autopass;;
*) typeField
"password") sleep $wait; typePass;;
"${AUTOTYPE_field}") sleep $wait; autopass;;
*) sleep $wait; typeField
esac
clearUp
elif [[ $default_do == "${AUTOTYPE_field}" ]]; then
autopass
sleep $wait; autopass
else
${default_do}
fi
Expand Down

0 comments on commit 3929c96

Please sign in to comment.