diff options
-rwxr-xr-x | rofi-pass | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -297,6 +297,16 @@ mainMenu () { if [[ $rofi_exit -eq 1 ]]; then exit fi + + # Actions based on exit code, which do not need the entry. + # The exit code for -kb-custom-X is X+9. + case "${rofi_exit}" in + 19) roots_index=$(( (roots_index-1+roots_length) % roots_length)); root=${roots[$roots_index]}; mainMenu;; + 20) roots_index=$(( (roots_index+1) % roots_length)); root=${roots[$roots_index]}; mainMenu;; + 25) helpMenu; return;; + 26) ${basecommand} --bmarks; return;; + esac + mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass "$selected_password") password=${password_temp[0]} if [[ ${password} == "#FILE="* ]]; then @@ -339,6 +349,7 @@ mainMenu () { pass_content="$(for key in "${!stuff[@]}"; do printf '%s\n' "${key}: ${stuff[$key]}"; done)" # actions based on keypresses + # The exit code for -kb-custom-X is X+9. case "${rofi_exit}" in 0) typeMenu;; 10) sleep $wait; autopass;; @@ -349,13 +360,9 @@ mainMenu () { 15) copyPass;; 16) viewEntry;; 17) copyURL;; - 18) export default_do="menu"; typeMenu;; - 19) roots_index=$(( (roots_index-1+roots_length) % roots_length)); root=${roots[$roots_index]}; mainMenu;; - 20) roots_index=$(( (roots_index+1) % roots_length)); root=${roots[$roots_index]}; mainMenu;; + 18) default_do="menu" typeMenu;; 23) actionMenu;; 24) copyMenu;; - 25) unset selected_password; helpMenu;; - 26) ${basecommand} --bmarks;; 27) insertPass;; esac clearUp @@ -401,7 +408,9 @@ typeMenu () { if [[ -n $default_do ]]; then if [[ $default_do == "menu" ]]; then checkIfPass - typefield=$(printf '%s\n' "${!stuff[@]}" | sort | _rofi -dmenu -p "Choose Field to type > ") + local -a keys=(${!stuff[@]}) + keys=(${keys[@]/$AUTOTYPE_field}) + typefield=$({ echo ${AUTOTYPE_field} ; printf '%s\n' "${keys[@]}" | sort; } | _rofi -dmenu -p "Choose Field to type > ") val=$? if [[ $val -eq 1 ]]; then exit |