diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-08-05 07:59:38 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-08-05 07:59:38 +0200 |
commit | e3e6ceb7c51ac1d1a9081c9720f63ae1f86fb42b (patch) | |
tree | 431cd8d0674aaa2eecd04c07ec80d86d81193072 | |
parent | e30878ed4b6cec8d2a775b0ba1acf1a6b3f50de1 (diff) | |
download | rofi-pass-e3e6ceb7c51ac1d1a9081c9720f63ae1f86fb42b.tar.gz |
re-open list when opening URL. This allows to directly enter passowrd after clicking the input field
-rwxr-xr-x | rofi-pass | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -58,9 +58,17 @@ xdotool_type() { mainMenu () { HELP="<span color='$help_color'>${autotype}: Autotype | ${type_user}: Type User | ${type_pass}: Type Password ${open_url}: Open URL | ${copy_name}: Copy Username | ${copy_pass}: Copy Password | ${show}: Show Entry</span>" - selected_password="$(echo -e "[ Add Entry ]>\n[ Manage Database ]>\n---\n$(list_passwords 2>/dev/null)" | rofi -i -mesg "${HELP}" -dmenu -kb-custom-1 "${autotype}" -kb-custom-2 "${type_user}" -kb-custom-3 "${type_pass}" -kb-custom-4 "${open_url}" -kb-custom-5 "${copy_name}" -kb-custom-6 "${copy_pass}" -kb-custom-7 "${show}" -dmenu -select "$entry" -p "rofi-pass > ")" + selected_password_temp="$(echo -e "[ Add Entry ]>\n[ Manage Database ]>\n---\n$(list_passwords 2>/dev/null)" | rofi -i -mesg "${HELP}" -dmenu -kb-custom-1 "${autotype}" -kb-custom-2 "${type_user}" -kb-custom-3 "${type_pass}" -kb-custom-4 "${open_url}" -kb-custom-5 "${copy_name}" -kb-custom-6 "${copy_pass}" -kb-custom-7 "${show}" -dmenu -select "$entry" -format "f¬s" -filter "$filter" -p "rofi-pass > ")" rofi_exit=$? - if [[ "${rofi_exit}" -eq 13 ]]; then $BROWSER "$(pass "$selected_password" | grep "URL: " | awk -F 'URL: ' '{ print $2 }')"; exit; + + selected_password="${selected_password_temp#*¬}" + unset filter + filter="${selected_password_temp%¬*}" + + rm -f "$HOME/.config/rofi-pass/last_used" + echo "$selected_password" > "$HOME/.config/rofi-pass/last_used" + + if [[ "${rofi_exit}" -eq 13 ]]; then $BROWSER "$(pass "$selected_password" | grep "URL: " | awk -F 'URL: ' '{ print $2 }')"; export entry="${selected_password}"; export filter="${filter}"; mainMenu elif [[ "${rofi_exit}" -eq 1 ]]; then exit ${rofi_exit}; elif [[ "${rofi_exit}" -eq 10 || "${rofi-exit}" -eq 0 ]]; then true fi |