From 617e8f940dc80fed61273f7b2e62224ed9f71fd7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Jun 2017 20:31:52 +0100 Subject: [PATCH] Wait bar --- src/freedombone-controlpanel | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index b610b6e4..ad0a130e 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -47,19 +47,39 @@ function please_wait { echo -n '' } -please_wait +#please_wait +max_files=0 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* for f in $UTILS_FILES do + max_files=$((max_files + 1)) +done +APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* +for f in $APP_FILES +do + max_files=$((max_files + 1)) +done + + +UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* +file_ctr=0 +echo "0" | dialog --gauge $"Please wait" 7 70 0 +for f in $UTILS_FILES +do + echo "$((file_ctr * 100 / max_files))" | dialog --gauge $"Please wait" 7 70 0 source $f + file_ctr=$((file_ctr + 1)) done APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* for f in $APP_FILES do + echo "$((file_ctr * 100 / max_files))" | dialog --gauge $"Please wait" 7 70 0 source $f + file_ctr=$((file_ctr + 1)) done +echo "100" | dialog --gauge $"Please wait" 7 70 0 COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt SELECTED_USERNAME=