aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-11-14 15:01:39 +0100
committerRasmus Steinke <rasi@xssn.at>2015-11-14 15:01:39 +0100
commitd2e6f2eda28c21673ec63c4dcd5a850c31ec97fb (patch)
tree4192323d1da9bb59f5aa2c3b03c8212145bc82ed
parent6327ba5a82ea050794610d9d15905a9f3457f0c5 (diff)
downloadrofi-pass-d2e6f2eda28c21673ec63c4dcd5a850c31ec97fb.tar.gz
add check for add pass entry1.3
-rwxr-xr-xrofi-pass29
1 files changed, 16 insertions, 13 deletions
diff --git a/rofi-pass b/rofi-pass
index 0b41afd..b457c3d 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -169,16 +169,20 @@ ${line3}</span>"
rofi_exit=$?
- # generate Array of fields
- password_temp=$(PASSWORD_STORE_DIR="${root}" pass "$selected_password")
- password=$(echo "${password_temp}" | head -1)
- declare -A stuff
- while read LINE; do
- _id=$(echo -e "${LINE}" | awk -F ':[[:space:]]*' '{print $1}')
- _val=$(echo -e "${LINE}" | awk '{sub(/:/,"")}{for (i=2; i<NF; i++) printf $i " "; print $NF}')
- stuff["${_id}"]=${_val}
- done < <(PASSWORD_STORE_DIR="${root}" pass "${selected_password}" | tail -n+2 | grep -P '(: |:\t)' )
- stuff["pass"]=${password}
+ if [[ ${selected_password} == "[ Add Entry ]>" ]]; then
+ :
+ else
+ # generate Array of fields
+ password_temp=$(PASSWORD_STORE_DIR="${root}" pass "$selected_password")
+ password=$(echo "${password_temp}" | head -1)
+ declare -A stuff
+ while read LINE; do
+ _id=$(echo -e "${LINE}" | awk -F ':[[:space:]]*' '{print $1}')
+ _val=$(echo -e "${LINE}" | awk '{sub(/:/,"")}{for (i=2; i<NF; i++) printf $i " "; print $NF}')
+ stuff["${_id}"]=${_val}
+ done < <(PASSWORD_STORE_DIR="${root}" pass "${selected_password}" | tail -n+2 | grep -P '(: |:\t)' )
+ stuff["pass"]=${password}
+ fi
# actions based on keypresses
if [[ "${rofi_exit}" -eq 0 ]]; then autopass;
@@ -193,7 +197,7 @@ ${line3}</span>"
elif [[ "${rofi_exit}" -eq 15 ]]; then copyPass;
elif [[ "${rofi_exit}" -eq 22 ]]; then typeMenu;
elif [[ "${rofi_exit}" -eq 23 ]]; then actionMenu;
- elif [[ "${rofi_exit}" -eq 25 ]]; then helpMenu;
+ elif [[ "${rofi_exit}" -eq 25 ]]; then unset selected_password; helpMenu;
elif [[ "${rofi_exit}" -eq 24 ]]; then copyMenu;
fi
password=''
@@ -206,8 +210,7 @@ ${line3}</span>"
}
helpMenu () {
- helptext=$(echo -e "${type_user}: Type User
-${autotype}: Autotype
+ helptext=$(echo -e "${autotype}: Autotype
${type_user}: Type Username
${type_pass}: Type Password
${type_menu}: Type Custom Field