From cb207dc4dbe663970b2b98e12c9f88bd9d20be1c Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Thu, 9 Jul 2015 02:20:18 +0200 Subject: [PATCH] add auto_enter option --- config.example | 3 ++- rofi-pass | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config.example b/config.example index 455075f..c954a79 100644 --- a/config.example +++ b/config.example @@ -14,7 +14,8 @@ BROWSER='chromium' ## Misc settings -help_color="#0C73C2" +help_color='#0C73C2' +auto_enter="'true' # Custom Keybindings autotype="Alt+1" diff --git a/rofi-pass b/rofi-pass index 6edd449..9d5504a 100755 --- a/rofi-pass +++ b/rofi-pass @@ -127,24 +127,37 @@ ${open_url}: Open URL | ${copy_name}: Copy Username | ${copy_pass}: Copy Passwor if [[ -z "${stuff['CustomOrder']}" ]]; then xdotool_type "${stuff[${USERNAME_field}]}" xdotool_type "$password" + if [[ ${auto_enter} == "true" ]]; then + xdotool key Return + fi else for word in ${stuff['CustomOrder']}; do xdotool_type "${stuff[${word}]}" done xdotool_type "$password" + if [[ ${auto_enter} == "true" ]]; then + xdotool key Return + fi fi - exit + exit else if [[ -z "${stuff['CustomOrder']}" ]]; then xdotool_type "${stuff[${USERNAME_field}]}" xdotool key Tab xdotool_type "$password" + sleep 1 + if [[ ${auto_enter} == "true" ]]; then + xdotool key Return + fi else for word in ${stuff['CustomOrder']}; do xdotool_type "${stuff[${word}]}" xdotool key Tab done xdotool_type "$password" + if [[ ${auto_enter} == "true" ]]; then + xdotool key Return + fi fi exit fi