allow non-root structure

This commit is contained in:
Rasmus Steinke 2015-05-30 11:15:04 +02:00
parent c8116f19b3
commit 992bcb2ee0
2 changed files with 8 additions and 2 deletions

View File

@ -15,3 +15,9 @@ BROWSER='chromium'
## Misc settings ## Misc settings
help_color="#0C73C2" help_color="#0C73C2"
## rofi expects a root directory in your basedir
## underneath this directory all your password groups
## are stored inside directories.
## if you don't want to separate roots, enable this setting
#root=.

View File

@ -20,7 +20,7 @@ if [[ -z $BROWSER ]]; then
fi fi
if [[ -n "$root" ]]; then if [[ -n "$root" ]]; then
root="$root" root="${root}"
else else
if [[ $(find "$basedir" -maxdepth 1 \( ! -name '.*' \) -type d | wc -l) == "1" ]]; then if [[ $(find "$basedir" -maxdepth 1 \( ! -name '.*' \) -type d | wc -l) == "1" ]]; then
root="$(find "${basedir}" -maxdepth 1 \( ! -name '.*' \) -type d -exec basename {} \;)" root="$(find "${basedir}" -maxdepth 1 \( ! -name '.*' \) -type d -exec basename {} \;)"
@ -158,7 +158,7 @@ show () {
elif [[ "$menu" == "" ]]; then elif [[ "$menu" == "" ]]; then
exit exit
elif [[ "$menu" == "Return to Main Menu" ]]; then elif [[ "$menu" == "Return to Main Menu" ]]; then
globalMenu mainMenu
else else
if [[ $(echo "$menu" | grep ": ") == "" ]]; then if [[ $(echo "$menu" | grep ": ") == "" ]]; then
if [[ $val -eq 11 ]]; then if [[ $val -eq 11 ]]; then