From c1f9920cb3823e9180eeecf0d3f94baf6439ae43 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Jun 2017 22:19:15 +0100 Subject: [PATCH] Show spinner --- src/freedombone-controlpanel | 42 +++++++++--------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index afe9adae..873d8b4f 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -51,48 +51,26 @@ function include_source { source $1 } -#please_wait +please_wait -utils_files=0 +spin='-\|/' +i=0 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* for f in $UTILS_FILES do - utils_files=$((utils_files + 1)) + i=$(( (i+1) %4 )) + printf "\r${spin:$i:1}" + source $f done -apps_files=0 + APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* for f in $APP_FILES do - apps_files=$((apps_files + 1)) + i=$(( (i+1) %4 )) + printf "\r${spin:$i:1}" + source $f done - -UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* -file_ctr=0 -dialog --title "$PROJECT_NAME" --gauge "Loading utils..." 7 75 < <( - for f in $UTILS_FILES - do - echo "$((file_ctr * 100 / utils_files))"; -cat <