From ff62ec6ca114020d43300565b7587e32f0b11d89 Mon Sep 17 00:00:00 2001 From: Dominik Hannen Date: Tue, 24 May 2016 23:21:56 +0200 Subject: This really fixes #39 --- rofi-pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rofi-pass b/rofi-pass index 6fd9d9a..aa13dc7 100755 --- a/rofi-pass +++ b/rofi-pass @@ -291,7 +291,7 @@ actionMenu () { showEntry () { HELP="${type_entry}: Type Entry | ${copy_entry}: Copy Entry" - bla=$(echo -e "0 Return\n---\n$(PASSWORD_STORE_DIR="${root}" pass "$selected_password")" | _rofi -dmenu -mesg "${HELP}" -p "> ") + bla=$({ echo -e "0 Return\n---"; PASSWORD_STORE_DIR="${root}" pass "$selected_password";} | _rofi -dmenu -mesg "${HELP}" -p "> ") rofi_exit=$? password_temp=$(PASSWORD_STORE_DIR="${root}" pass "$selected_password") password=$(echo "${password_temp}" | head -1) -- cgit From 011fe2993b7fb06a2d542a2cef78fe88b50b0f70 Mon Sep 17 00:00:00 2001 From: Dominik Hannen Date: Wed, 25 May 2016 00:03:11 +0200 Subject: Fix more backslash issues. The Software should now work correctly with any backslashed input, output, fieldnames and values. --- rofi-pass | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/rofi-pass b/rofi-pass index aa13dc7..0b48534 100755 --- a/rofi-pass +++ b/rofi-pass @@ -149,7 +149,7 @@ generatePass () { # main Menu mainMenu () { if [[ $1 == "--bmarks" ]]; then - selected_password="$(echo -e "$(list_passwords 2>/dev/null)" \ + selected_password="$(list_passwords 2>/dev/null \ | _rofi -mesg "Bookmarks Mode. ${switch} to switch" \ -dmenu \ -kb-custom-1 "Alt+x" \ @@ -167,12 +167,12 @@ mainMenu () { fi else unset selected_password - help_text=$(echo -e "Enter: Autotype - ${action_menu}: Actions - ${show}: View\n${type_menu}: Type Field - ${copy_menu}: Copy Field - ${help}: Help" | column -s '-' -t) + help_text=$({ echo -e "Enter: Autotype - ${action_menu}: Actions - ${show}: View"; echo "${type_menu}: Type Field - ${copy_menu}: Copy Field - ${help}: Help";} | column -s '-' -t) line1=$(echo "${help_text}" | head -1) line3=$(echo "${help_text}" | tail -1) HELP="${line1} ${line3}" - selected_password="$(echo -e "[ Add Entry ]>\n---\n$(list_passwords 2>/dev/null)" \ + selected_password="$({ echo -e "[ Add Entry ]>\n---"; list_passwords 2>/dev/null;} \ | _rofi -mesg "${HELP}" \ -dmenu -kb-custom-1 "${autotype}" \ -kb-custom-2 "${type_user}" \ @@ -202,8 +202,8 @@ ${line3}" password=$(echo "${password_temp}" | head -1) declare -A stuff while read -r LINE; do - _id=$(echo -e "${LINE}" | gawk -F ':[[:space:]]*' '{print $1}') - _val=$(echo -e "${LINE}" | gawk '{sub(/:/,"")}{for (i=2; i ") + typefield=$({ echo -e "< Return\n---\npassword"; pass "${selected_password}" | grep -P ':[\t ]' | gawk -F ':' '{ print $1 }';} | _rofi -dmenu -p "Choose Field to type > ") if [[ $typefield == "" ]]; then exit; elif [[ $typefield == "password" ]]; then typePass; elif [[ $typefield == "< Return" ]]; then mainMenu; @@ -269,7 +269,7 @@ typeMenu () { copyMenu () { checkIfPass - copyfield=$(echo -e "< Return\n---\npassword\n$(pass "${selected_password}" | grep -P ':[\t ]' | gawk -F ':' '{ print $1 }')" | _rofi -dmenu -p "Choose Field to copy > ") + copyfield=$({ echo -e "< Return\n---\npassword"; pass "${selected_password}" | grep -P ':[\t ]' | gawk -F ':' '{ print $1 }';} | _rofi -dmenu -p "Choose Field to copy > ") if [[ $copyfield == "" ]]; then exit; elif [[ $copyfield == "password" ]]; then copyPass; elif [[ $copyfield == "< Return" ]]; then mainMenu; @@ -298,8 +298,8 @@ showEntry () { declare -A stuff while read -r LINE; do - _id=$(echo -e "${LINE}" | gawk -F ':[[:space:]]*' '{print $1}') - _val=$(echo -e "${LINE}" | gawk '{sub(/:/,"")}{for (i=2; iFor faster adding use the addpass command" -p "Add Entry > ") + insertmenu=$({ echo -e "0 Return to Main Menu\n* Accept Values and Add Password Entry\n---"; echo "1 Name ($name)"; echo "2 URL ($domain)"; echo "3 User ($user)"; echo "4 Password ($pass2)"; } | _rofi -dmenu -mesg "For faster adding use the addpass command" -p "Add Entry > ") insert_val=$? if [[ $insert_val -eq 1 ]]; then exit else @@ -405,13 +405,23 @@ insertPass () { elif [[ $insertmenu == "" ]]; then exit elif [[ $insertmenu == "* Accept Values and Add Password Entry" ]]; then cd "${root}" || exit - group=$(echo -e "No Group\n---\n$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2-)" | _rofi -dmenu -p "Choose Group > ") + group=$({ echo -e "No Group\n---"; find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2-;} | _rofi -dmenu -p "Choose Group > ") if [[ "$group" == "No Group" ]]; then - PASSWORD_STORE_DIR="${root}" pass insert -m -f "${name}" < <(echo -e "${pass}\n${USERNAME_field}: ${user}\n---\n${URL_field}: ${domain}") + { + echo "${pass}" + echo "${USERNAME_field}: ${user}" + echo "---" + echo "${URL_field}: ${domain}" + } | PASSWORD_STORE_DIR="${root}" pass insert -m -f "${name}" elif [[ "$group" == "" ]]; then exit else - PASSWORD_STORE_DIR="${root}" pass insert -m -f "${group}/${name}" < <(echo -e "${pass}\nU${USERNAME_field}: ${user}\n---\n${URL_field}: ${domain}") + { + echo "${pass}" + echo "${USERNAME_field}: ${user}" + echo "---" + echo "${URL_field}: ${domain}" + } | PASSWORD_STORE_DIR="${root}" pass insert -m -f "${group}/${name}" fi exit elif [[ $insertmenu == "1 Name"* ]]; then -- cgit