From 9ff6e333abe085730621d0c0c7d91dc3b7f011dc Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Thu, 19 May 2016 19:54:41 +0200 Subject: [PATCH] dont send tab when no username field exists in password file - fixed #37 --- rofi-pass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rofi-pass b/rofi-pass index a858c02..d96b1e4 100755 --- a/rofi-pass +++ b/rofi-pass @@ -41,8 +41,10 @@ autopass () { rm -f "/tmp/$USER-rofi-pass/last_used" echo "${root}: $selected_password" > "/tmp/$USER-rofi-pass/last_used" if [[ -z "${stuff["$AUTOTYPE_field"]}" ]]; then - echo -n "${stuff["${USERNAME_field}"]}" | xdotool type --clearmodifiers --file - - xdotool key Tab + if [[ "${stuff["${USERNAME_field}"]}" ]]; then + echo -n "${stuff["${USERNAME_field}"]}" | xdotool type --clearmodifiers --file - + xdotool key Tab + fi echo -n "${password}" | xdotool type --clearmodifiers --file - sleep 1 if [[ ${auto_enter} == "true" ]]; then xdotool key Return; fi