I've fudged together a simple progress bar GUI I use for some of my install and backup scripts and thought others may find a use for it.
It uses existing PocketBook system resources, so no additional files required.
Just save the code below as an
.app file in
/mnt/ext1/applications
Here's the code:
Spoiler:
(you may need to scroll down to see all)
Code:
#!/bin/sh
#### Tweak as required ####
progBarLength=40
progBarUnitSize=8
# length/UnitSize = number of times outputProgress will need
# to be called to fill progress bar. (e,g, 40/8=5)
messageRunning="Process running, please wait..."
messageComplete="Process Complete!"
####
# display background and progress bar
dialog=/ebrmain/cramfs/bin/dialog
progBar="$(printf '%*s' $progBarLength "" | tr ' ' '_')"
emptyUnit=$(printf '%*s' $progBarUnitSize "" | tr ' ' '_')
fullUnit=$(printf '%*s' $progBarUnitSize "" | tr ' ' '=')
i=1; outputProgress() {
background="/ebrmain/bin/run_script -clear_screen -bitmap=progress_gear_$i"
let "i=i+1"; if [ $i == 5 ]; then i=1; fi
$background; iv2sh SetActiveTask $$
($dialog 1 "" "$messageRunning" "Progress: $progBar") &
progBar=${progBar/$emptyUnit/$fullUnit}
sleep 1; }; outputProgress
#### add your code sections between function calls ####
# insert your code
outputProgress #1
# insert your code
outputProgress #2
# insert your code
outputProgress #3
# insert your code
outputProgress #4
# insert your code
outputProgress #5
####
# confirmation and exit
/ebrmain/bin/run_script -clear_screen -bitmap=congrat_icon_up
iv2sh SetActiveTask $$; $dialog 3 "" "$messageComplete" "" "ok" ""
iv2sh SetActiveTask `pidof bookshelf.app`; pkill -f /bin/sh
exit
It can be ran as-is to demo. I'd be interested to know what it looks like on different devices.
Works in regular and dark-mode... actually looks a little better in the latter.
Screenshots attached...