diff options
author | Rasmus Steinke <rasi@xssn.at> | 2016-04-10 11:51:35 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2016-04-10 11:51:35 +0200 |
commit | 42a3cfff05e2db582ec8d6b0917981e10bb6c15b (patch) | |
tree | 2973713fbcaeef042db1d4916a4408d786c7bcc0 | |
parent | 75cf7151588927122d696dc1daa95fee1ba43644 (diff) | |
parent | c8e49102b2faad6102ea4e9bc47444ce792a444d (diff) | |
download | rofi-pass-42a3cfff05e2db582ec8d6b0917981e10bb6c15b.tar.gz |
Merge pull request #35 from x4121/master
Check if /tmp/$USER-rofi-pass/last_used exists
-rwxr-xr-x | rofi-pass | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -513,7 +513,7 @@ if [[ -z ${count} ]]; then fi # check if alternative root directory was given on commandline -if [[ $1 == "--last-used" || $1 == "--show-last" ]]; then +if [[ -r "/tmp/$USER-rofi-pass/last_used" ]] && [[ $1 == "--last-used" || $1 == "--show-last" ]]; then export root=$(awk -F ': ' '{ print $1 }' /tmp/$USER-rofi-pass/last_used) elif [[ -n "$2" && "$1" == "--root" ]]; then export root="${2}" @@ -539,10 +539,17 @@ export PASSWORD_STORE_DIR="${root}" help_msg ;; --last-used) - entry="$(awk -F ': ' '{ print $2 }' /tmp/$USER-rofi-pass/last_used)" mainMenu + if [[ -r "/tmp/$USER-rofi-pass/last_used" ]]; then + entry="$(awk -F ': ' '{ print $2 }' /tmp/$USER-rofi-pass/last_used)" + fi + mainMenu ;; --show-last) - selected_password="$(awk -F ': ' '{ print $2 }' /tmp/$USER-rofi-pass/last_used)" showEntry + if [[ -r "/tmp/$USER-rofi-pass/last_used" ]]; then + selected_password="$(awk -F ': ' '{ print $2 }' /tmp/$USER-rofi-pass/last_used)" showEntry + else + mainMenu + fi ;; --bmarks) mainMenu --bmarks; |