From b9b8a57cf02f4373ad9e1107b1bbd14409db1900 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:32:58 +0200 Subject: Remove extra $(..) to avoid executing output of shell command. --- rofi-pass | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rofi-pass b/rofi-pass index cd7dfed..02b8dff 100755 --- a/rofi-pass +++ b/rofi-pass @@ -249,7 +249,7 @@ mainMenu () { if [[ $rofi_exit -eq 1 ]]; then exit elif [[ $rofi_exit -eq 10 ]]; then - $(${basecommand}) + ${basecommand} elif [[ $rofi_exit -eq 0 ]]; then openURL fi @@ -341,7 +341,7 @@ Run ${default_do} with Enter. For more help hit elif [[ "${rofi_exit}" -eq 23 ]]; then actionMenu; elif [[ "${rofi_exit}" -eq 25 ]]; then unset selected_password; helpMenu; elif [[ "${rofi_exit}" -eq 24 ]]; then copyMenu; - elif [[ "${rofi_exit}" -eq 26 ]]; then $(${basecommand} --bmarks); + elif [[ "${rofi_exit}" -eq 26 ]]; then ${basecommand} --bmarks; elif [[ "${rofi_exit}" -eq 27 ]]; then insertPass; fi clearUp @@ -401,7 +401,7 @@ typeMenu () { elif [[ $default_do == "${AUTOTYPE_field}" ]]; then autopass else - $(${default_do}) + ${default_do} fi fi } @@ -483,10 +483,10 @@ showEntry () { fi if [[ $notify == "true" ]] then - $(sleep 45; echo -n "" | xclip; echo "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") & + (sleep 45; echo -n "" | xclip; echo "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") & elif [[ $notify == "false" ]] then - $(sleep 45; echo -n "" | xclip; echo "" | xclip -selection clipboard) & + (sleep 45; echo -n "" | xclip; echo "" | xclip -selection clipboard) & fi exit fi -- cgit From b49b409187f53fa200922199c90fecd29240ec5e Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:35:43 +0200 Subject: Specify -r to read to handle backslashes properly. --- rofi-pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rofi-pass b/rofi-pass index 02b8dff..e2ad204 100755 --- a/rofi-pass +++ b/rofi-pass @@ -52,7 +52,7 @@ list_passwords() { cd "${root}" || exit find -L . -iname '*.gpg' -printf '%P\n' | \ - while read filename; do + while read -r filename; do echo "${filename%.gpg}" done } -- cgit From 29d5608ecf71ce7780be7ace0820538505d86d9e Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:37:52 +0200 Subject: Specify directory for find explicitly. Some find implementations don't have a default directory functionality. --- rofi-pass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rofi-pass b/rofi-pass index e2ad204..87975b0 100755 --- a/rofi-pass +++ b/rofi-pass @@ -507,7 +507,7 @@ manageEntry () { elif [[ $1 == "move" ]]; then cd "${root}" || exit selected_password2=$(basename "$selected_password" .gpg) - group=$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") + group=$(find . -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") if [[ $group == "" ]]; then exit fi @@ -517,7 +517,7 @@ manageEntry () { cd "${root}" || exit selected_password2=$(basename "$selected_password" .gpg) original_group=$(dirname "${selected_password}") - group=$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") + group=$(find . -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") if [[ $group == "" ]]; then exit else @@ -558,7 +558,7 @@ insertPass () { if [[ $val -eq 1 ]]; then exit fi - 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---\n$(find . -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2-)" | rofi -dmenu -p "Choose Group > ") val=$? if [[ $val -eq 1 ]]; then exit -- cgit From 51296819097ef761d5a8a9f5cd96b50cd3a4b484 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:40:02 +0200 Subject: Remove unused variable. --- rofi-pass | 1 - 1 file changed, 1 deletion(-) diff --git a/rofi-pass b/rofi-pass index 87975b0..5e03202 100755 --- a/rofi-pass +++ b/rofi-pass @@ -36,7 +36,6 @@ copy_url="Alt+l" copy_pass="Alt+p" show="Alt+o" copy_entry="Alt+2" -type_entry="Alt+1" copy_menu="Alt+c" action_menu="Alt+a" type_menu="Alt+t" -- cgit From d7812ea4f93104d013c77e8a6288a3003663d000 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:41:45 +0200 Subject: Remove trailing whitespace. --- rofi-pass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rofi-pass b/rofi-pass index 5e03202..f5b5f5e 100755 --- a/rofi-pass +++ b/rofi-pass @@ -519,7 +519,7 @@ manageEntry () { group=$(find . -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") if [[ $group == "" ]]; then exit - else + else new_name="$(listgpg | rofi -dmenu -format 'f' -mesg "Copying to same Group. Please enter a name for the new entry" -p "> ")" fi PASSWORD_STORE_DIR="${root}" pass cp "$selected_password" "${group}/${new_name}" @@ -562,7 +562,7 @@ insertPass () { if [[ $val -eq 1 ]]; then exit fi - + pw=$(echo -e "Generate" | rofi -dmenu -p "Password > " -mesg "Type Password or hit Enter to generate one") if [[ $pw == "Generate" ]]; then pw=$(pwgen "${password_length}") -- cgit From f0bd11bfa73d02a1f46a7933ca6f6f9a1c6ffd08 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:47:19 +0200 Subject: Remove unused variable assignments. --- rofi-pass | 3 --- 1 file changed, 3 deletions(-) diff --git a/rofi-pass b/rofi-pass index f5b5f5e..29a87a5 100755 --- a/rofi-pass +++ b/rofi-pass @@ -505,7 +505,6 @@ manageEntry () { mainMenu elif [[ $1 == "move" ]]; then cd "${root}" || exit - selected_password2=$(basename "$selected_password" .gpg) group=$(find . -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") if [[ $group == "" ]]; then exit @@ -514,8 +513,6 @@ manageEntry () { mainMenu elif [[ $1 == "copy" ]]; then cd "${root}" || exit - selected_password2=$(basename "$selected_password" .gpg) - original_group=$(dirname "${selected_password}") group=$(find . -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ") if [[ $group == "" ]]; then exit -- cgit From 516fcb6d39f48ae0bc6d833181e5d5faeb125412 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 14 Jul 2017 18:47:37 +0200 Subject: Exit if cd fails. --- rofi-pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rofi-pass b/rofi-pass index 29a87a5..d5739d3 100755 --- a/rofi-pass +++ b/rofi-pass @@ -542,7 +542,7 @@ listgpg () { insertPass () { url=$(xclip -o) - cd "${root}" + cd "${root}" || exit name="$(listgpg | rofi -dmenu -format 'f' -mesg "Type name, make sure it is unique" -p "> ")" # name="$(echo -e "$(list_passwords 2>/dev/null)" | rofi -dmenu -mesg "Type name, make sure it is unique" -p "> ")" val=$? -- cgit