aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2016-08-04 05:54:08 +0200
committerRasmus Steinke <rasi@xssn.at>2016-08-04 05:54:08 +0200
commitca70a0e77731675a0a9c10ea28ab58a06b3cdfb7 (patch)
tree9122b730299907516b0548b9af5f09fe005f24a4
parent132dce5a5f29d3af776ef647e96cf319dabe0e8b (diff)
downloadrofi-pass-ca70a0e77731675a0a9c10ea28ab58a06b3cdfb7.tar.gz
fix --show-last
-rwxr-xr-xrofi-pass21
1 files changed, 20 insertions, 1 deletions
diff --git a/rofi-pass b/rofi-pass
index 08cea2d..1ff9999 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -376,6 +376,25 @@ actionMenu () {
}
showEntry () {
+ if [[ -z $pass_content ]]; then
+ password_temp=$(PASSWORD_STORE_DIR="${root}" pass "$selected_password")
+ password="${password_temp%%$'\n'*}"
+ pass_key_value=$(echo "${password_temp}" | tail -n+2 | grep ': ')
+ declare -A stuff
+ while read -r LINE; do
+ _id="${LINE%%: *}"
+ _val="${LINE#* }"
+ stuff["${_id}"]=${_val}
+ done < <(echo "${pass_key_value}")
+ stuff["pass"]=${password}
+ if test "${stuff['autotype']+autotype}"
+ then
+ :
+ else
+ stuff["autotype"]="user :tab pass"
+ fi
+ pass_content="$(for key in "${!stuff[@]}"; do echo "${key}: ${stuff[$key]}"; done)"
+ fi
HELP="<span color='${help_color}'>${copy_entry}: Copy Entry</span>"
bla=$(echo -e "< Return\n${pass_content}" | _rofi -kb-accept-entry '!Return' -dmenu -mesg "Enter: Copy entry to clipboard" -p "> ")
rofi_exit=$?
@@ -553,7 +572,7 @@ export PASSWORD_STORE_DIR="${root}"
;;
--show-last)
if [[ -r "$HOME/.cache/rofi-pass/last_used" ]]; then
- selected_password="$(awk -F ': ' '{ print $2 }' "$HOME/.cache/rofi-pass/last_used")" showEntry
+ selected_password="$(awk -F ': ' '{ print $2 }' "$HOME/.cache/rofi-pass/last_used")" viewEntry
else
mainMenu
fi