Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-22-2025, 02:28 PM   #1
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,906
Karma: 12983233
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
Progress bar GUI for scripts

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...
Attached Thumbnails
Click image for larger version

Name:	inst_active.jpg
Views:	130
Size:	53.8 KB
ID:	215226   Click image for larger version

Name:	inst_comp.jpg
Views:	120
Size:	46.3 KB
ID:	215227  
neil_swann80 is offline   Reply With Quote
Old 10-27-2025, 09:43 AM   #2
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 809
Karma: 628976
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Hi, almost forgot your post. Included it in an app and it gives a nice feedback during the download process encoraging the user not to destroy his screen while waiting patiently for the download process to succeed.
Attached Thumbnails
Click image for larger version

Name:	image05.jpg
Views:	5
Size:	96.0 KB
ID:	218899   Click image for larger version

Name:	image06.jpg
Views:	5
Size:	93.1 KB
ID:	218900   Click image for larger version

Name:	image07.jpg
Views:	5
Size:	97.8 KB
ID:	218901   Click image for larger version

Name:	image08.jpg
Views:	5
Size:	107.1 KB
ID:	218902   Click image for larger version

Name:	image09.jpg
Views:	5
Size:	140.3 KB
ID:	218903  

Last edited by nhedgehog; 10-27-2025 at 09:46 AM.
nhedgehog is offline   Reply With Quote
Old 10-27-2025, 10:04 AM   #3
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 809
Karma: 628976
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Pics are from Inkpad X (U1040.6.8.4083). Looking good on PB Era Color (U700k3.6.8.3687), Touch HD2 (U631.5.201527-though it does need different icon names) too.

Last edited by nhedgehog; 10-27-2025 at 12:07 PM.
nhedgehog is offline   Reply With Quote
Old Yesterday, 12:17 AM   #4
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,906
Karma: 12983233
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
I'm pleased that's working for you!

Interesting that the icon names changed.

Last edited by neil_swann80; Yesterday at 01:18 AM.
neil_swann80 is offline   Reply With Quote
Old Yesterday, 01:42 AM   #5
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 809
Karma: 628976
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
BTW: It looks the same on all the devices (with the exclusion of the missing icons).

Last edited by nhedgehog; Yesterday at 01:45 AM.
nhedgehog is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress bar? Pjama Kindle Developer's Corner 2 04-06-2022 10:57 AM
Progress bar: this unknown. (chapter progress) gabryele Kobo Reader 23 12-14-2019 06:02 PM
Progress bar? frogette Which one should I buy? 13 10-18-2014 04:01 AM
remove Progress bar at K4 NT. rtzui Amazon Kindle 0 10-21-2013 09:58 AM
GUI Frontend for python scripts [windows] - seeking mod input first sherman Workshop 7 04-27-2009 01:04 AM


All times are GMT -4. The time now is 05:45 AM.


MobileRead.com is a privately owned, operated and funded community.