diff options
-rwxr-xr-x | rofi-pass | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -298,6 +298,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 @@ -340,6 +350,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;; @@ -350,13 +361,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 |