aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrofi-pass12
1 files changed, 10 insertions, 2 deletions
diff --git a/rofi-pass b/rofi-pass
index 362ec70..d55c89b 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -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