Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-16-2019, 12:55 AM   #1
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
(Project) Drawgress Bar — KUAL extension

Dear MobileRead community,
I really miss the old full-scale progress bar. I even wrote feedback to Amazon and asked them to return it. Meanwhile I am waiting for them to take actions, I gathered some thoughts.
I hope for your help! Let's finish this together

Goal: to write a KUAL extension that non-intrusively draws full progress bar line with chapter marks (both level 1 and level 2) on each page turn (every-page turn script example is Showtime).
By 'non-intrusive' I mean that it should be more like an overlay written as a script, rather than Java-Bytecode patch.
Hoping that methods of getting book info stay the same, this extension should be compatible with future updates.


Script outline is given below. I only half-finished drawing script, due to lack of experience in bash.
Attached an example of such a progress bar (drawn in fbink manually)

Spoiler:

Initial conditions:
- define/determine screen size

Once book is open:
- get book size (location/pages) (value)
- get chapter count, level 1 and level 2 (values)
- get chapter sizes, level 1 and level 2 (vectors)
- get current position
- draw progress bar with fbink

Every Page turn:
- get current position
- redraw

Drawing method:
1) Draw 100%-width of light-gray progress bar
Code:
fbink -t regular=/usr/java/lib/fonts/Baskerville-Regular.ttf,size=7,top=1415,bottom=0,left=350,right=0 -B GRAYC "                                                                                                     "
2) Draw in loop 1%-width parts up to read percent dark-gray progress bar (from i=0 to read_percent)
Code:
fbink -t regular=/usr/java/lib/fonts/Baskerville-Regular.ttf,size=7,top=1415,bottom=0,left=350,right=50 -B GRAY7 "  "
3) Draw in loop up to number of level 1 chapters
Code:
fbink -t regular=/usr/java/lib/fonts/Baskerville-Regular.ttf,size=7,top=1415,bottom=0,left=350,right=50 -O "|"
4) Draw in loop up to number of level 2 chapters
Code:
fbink -t regular=/usr/java/lib/fonts/Baskerville-Regular.ttf,size=7,top=1415,bottom=0,left=390,right=50 -O "·"
So for PW3 (1072x1440, 300 dpi) I have my progress bar located from 350th pixel up to 950th pixel. Each 1% refers to 6 pixels. In the first fbink command there are 101 spaces (somehow fbink doesn't draw with command of " " (1 space), but " " (2 spaces) command produces in fact 1 space), so in fact each 6 pixels is 1% of the book length.
I hope that for other resolutions it should be trivial to scale down/up.



For now I am really stuck with:
— Getting info about current opened book
— Getting pages/locations, chapters info
Where do I even start?
I remember that native booklet is in Java, but I don't know how to extract working values from there.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2019_01_16T00_36_59-0500.png
Views:	490
Size:	97.2 KB
ID:	169126  
mergen3107 is offline   Reply With Quote
Old 01-16-2019, 11:47 AM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
A few things:

* You'll probably never be able to get the info you want from outside the framework itself. Which pretty much makes this whole thing impossible.

* As for FBInk, I have a vague inkling why you're trying to use the TTF codepath while never actually really printing "text", but it probably wouldn't be portable.

The internal API has rectangle drawing helpers, but they're not exposed.
For something like this, I'd simply draw an "image" (i.e., a simple w*h array, as 1px = 1byte) myself and print that via the raw printing feature (you can get the screen dimensions via FBInk, c.f. -e & get_state).
Pro: That'll save you the seven million refreshes you're currently not inhibiting (-b) .
Con: That's an API-only feature, meaning no shell .

(As for 2., that's a quirk of the linebreaking feature, a string composed only of a single space is probably considered as a viable break-point, which makes it zero-width).

Last edited by NiLuJe; 01-16-2019 at 11:53 AM.
NiLuJe is offline   Reply With Quote
Advert
Old 01-16-2019, 01:40 PM   #3
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
@NiLuJe
Thank you for input!

Then, how about a little java-patch that will only print these values into an external file? I suppose JBPatch had access to all that info for drawing its own progress bar. I am currently trying to understand its source code.

The reason I used TTF is that Bookerly's symbols are nicer that these of the built-in ones, I tried all of them.
"The inernal API" of what exactly you mean?
mergen3107 is offline   Reply With Quote
Old 01-16-2019, 03:37 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Dealing with Java stuff is hellish because it's obfuscated, and re-obfuscated on every FW build (which means it might differ between devices, even for the same FW "version"), even when there were no actual code changes.

This is incidentally why JBPatch stopped being maintained: maintaining the patches was becoming increasingly annoying.

(I meant FBInk's internal API ).
NiLuJe is offline   Reply With Quote
Old 01-16-2019, 04:37 PM   #5
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
@NiLuJe
thank you for clearing this out!
Okay, so let's leave alone Java booklet.

I am going to approach from different side:
1) I was able to find book length and its current progress in /var/local/cc.db . However, I don't know how to extract these values from shell. I read a few tutorials on sqlite, but they only allow to change values inside the database, not extract them. How can I extract them?
2) Chapters structure prorbably I can extract from mobi files themselves. This idea comes from Calibre plug-ins capability. I am thinking on something like preparation files (with chapters info) which are put next to each respective book so that the script can go and find it.
3) The only real problem for now seems to identify which book is currently open. I'll think on it after I solve first two For now I guess I should enter them manually in the script.

Last edited by mergen3107; 01-16-2019 at 04:39 PM.
mergen3107 is offline   Reply With Quote
Advert
Old 01-16-2019, 05:20 PM   #6
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,263
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Study the SQL command named SELECT
j.p.s is offline   Reply With Quote
Old 01-16-2019, 06:25 PM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by mergen3107 View Post
@NiLuJe
thank you for clearing this out!
Okay, so let's leave alone Java booklet.

I am going to approach from different side:
1) I was able to find book length and its current progress in /var/local/cc.db . However, I don't know how to extract these values from shell. I read a few tutorials on sqlite, but they only allow to change values inside the database, not extract them. How can I extract them?
https://www.sqlite.org/lang_select.html
Quote:
2) Chapters structure prorbably I can extract from mobi files themselves. This idea comes from Calibre plug-ins capability. I am thinking on something like preparation files (with chapters info) which are put next to each respective book so that the script can go and find it.
3) The only real problem for now seems to identify which book is currently open. I'll think on it after I solve first two For now I guess I should enter them manually in the script.
Quote:
Originally Posted by j.p.s View Post
Study the SQL command named SELECT
The full application is pre-installed.
See: https://www.sqlite.org/docs.html
And (picture): https://www.sqlite.org/lang.html

There is also both a Lua and a Java interface to the SQLite3 library.
Note: As-built, the pre-installed sqlite3 can not handle the locale setting used by a (very) few of the db tables.

The Lua and the Java interfaces to the SQLite3 library do not have that problem.

Both NiLuJe and myself have stand-alone builds available that can handle any Unicode locale (but they are REALLY BIG files).

Last edited by knc1; 01-16-2019 at 06:32 PM.
knc1 is offline   Reply With Quote
Old 01-16-2019, 10:20 PM   #8
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@knc1: Yep, in my case, it's bundled with Python (on FW >= 4.x), but it is NOT symlinked, so as not to clobber the system version .

Not that I've ever had to actually use it, though .

@mergen3107: 3/ The cover mode bit of the ScreenSavers hack picks it up from the cc.db (after having picked up a book open event from lipc (c.f., cover-watchdog/cover-watchdog-helper & cover-extract).
NiLuJe is offline   Reply With Quote
Old 01-16-2019, 10:53 PM   #9
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
Thank you guys! I'll look thoroughly at these things
mergen3107 is offline   Reply With Quote
Old 01-18-2019, 02:43 AM   #10
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
Some updates on my investigation.

1) I used showlog -f to see what is going on with the opened book. I was able to get something like this:
Code:
...
190113:223323 cvm[15492]: I ReaderInfoLog:BookInformation:book asin=f3203e96-c039-416b-aa47-9082f48637e3,file size=2200211,file last mod date=2018-11-18 18.56.26 -0500,content type=ebook,language=en/en,length=MobiPosition_ 1530687,access=2019-01-13 22.28.24 -0500,last read position=MobiSerializedPosition_ 968606 968607,isEncrypted=false,isSample=false,isNew=false,isTTSMetdataPresent=false,isTTSMetadataAllowed=true,fileExtn=mobi:
...
These length=MobiPosition_ 1530687 and last read position=MobiSerializedPosition_ 968606 968607 are definitely within my interest, however only the former appears in the cc.db . These values from showlog and cc.db match: 'length' and 'p_contentSize'; calculated 'last read position'/'length' and 'p_percentFinished' (about 63%).

2) @NiLuJe,
Thank you very much!
I tried your part of code from 'cover'extract' about extracting sqlite entries into variable and it works. So now I can tweak my needs of fetching these pieces of data from the last opened book. Particularly I only need p_contentSize, p_percentFinished types of data.

One problem I found though is that cc.db seems to be updated upon each book close, not every page turn. So now I have to think about how to properly determine current position to redraw it.

3) I used KindleUnpack plugin in Calibre to see mobi7 and mobi8 (azw3) files' contents.
For mobi7 toc.ncx file easily shows file position of each TOC entry:
Code:
...
<navMap>
    <navPoint id="np_1" playOrder="1">
    <navLabel>
    <text>Title Page</text>
    </navLabel>
    <content src="book.html#filepos241"/>
    </navPoint>
    <navPoint id="np_2" playOrder="2">
    <navLabel>
    <text>Copyright</text>
    </navLabel>
    <content src="book.html#filepos816"/>
    </navPoint>
    <navPoint id="np_3" playOrder="3">
...
As for mobi8, however, it is a little more tricky! toc.ncx does not reveal entries' position, but only tocref### references. Surprisingly for me, mobi8 files resemble epub files a lot, which also rely only on xhtml content size.
However, %book/Text/ folder contains separate files, each of which represents just another TOC entry (but it doesn't differentiate of which level).

So I am thinking about two things:
1) I should give up on different TOC level indications on progress bar;
2) I can calculate very rough position of these TOC entries based on ... cumulative file sizes with respect to total file size of this folder I tried it manually by hand on Victor Hugo's 'Les Miserables' (about 2500 print pages) and it works within +/- 3%

I'll try to write a little PC script (when I find enough free time) to pre-process mobi7 and mobi8 files to extract TOC entries' positions.

Last edited by mergen3107; 01-18-2019 at 03:07 AM.
mergen3107 is offline   Reply With Quote
Old 01-29-2019, 05:16 AM   #11
PromethiumL
Member
PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'PromethiumL knows the difference between 'who' and 'whom'
 
Posts: 22
Karma: 10000
Join Date: Mar 2018
Location: HK
Device: KOA2
Another approch?

Quote:
Originally Posted by mergen3107 View Post
Some updates on my investigation.

1) I used showlog -f to see what is going on with the opened book. I was able to get something like this:
Code:
...
190113:223323 cvm[15492]: I ReaderInfoLog:BookInformation:book asin=f3203e96-c039-416b-aa47-9082f48637e3,file size=2200211,file last mod date=2018-11-18 18.56.26 -0500,content type=ebook,language=en/en,length=MobiPosition_ 1530687,access=2019-01-13 22.28.24 -0500,last read position=MobiSerializedPosition_ 968606 968607,isEncrypted=false,isSample=false,isNew=false,isTTSMetdataPresent=false,isTTSMetadataAllowed=true,fileExtn=mobi:
...
These length=MobiPosition_ 1530687 and last read position=MobiSerializedPosition_ 968606 968607 are definitely within my interest, however only the former appears in the cc.db . These values from showlog and cc.db match: 'length' and 'p_contentSize'; calculated 'last read position'/'length' and 'p_percentFinished' (about 63%).

2) @NiLuJe,
Thank you very much!
I tried your part of code from 'cover'extract' about extracting sqlite entries into variable and it works. So now I can tweak my needs of fetching these pieces of data from the last opened book. Particularly I only need p_contentSize, p_percentFinished types of data.

One problem I found though is that cc.db seems to be updated upon each book close, not every page turn. So now I have to think about how to properly determine current position to redraw it.

3) I used KindleUnpack plugin in Calibre to see mobi7 and mobi8 (azw3) files' contents.
For mobi7 toc.ncx file easily shows file position of each TOC entry:
Code:
...
<navMap>
    <navPoint id="np_1" playOrder="1">
    <navLabel>
    <text>Title Page</text>
    </navLabel>
    <content src="book.html#filepos241"/>
    </navPoint>
    <navPoint id="np_2" playOrder="2">
    <navLabel>
    <text>Copyright</text>
    </navLabel>
    <content src="book.html#filepos816"/>
    </navPoint>
    <navPoint id="np_3" playOrder="3">
...
As for mobi8, however, it is a little more tricky! toc.ncx does not reveal entries' position, but only tocref### references. Surprisingly for me, mobi8 files resemble epub files a lot, which also rely only on xhtml content size.
However, %book/Text/ folder contains separate files, each of which represents just another TOC entry (but it doesn't differentiate of which level).

So I am thinking about two things:
1) I should give up on different TOC level indications on progress bar;
2) I can calculate very rough position of these TOC entries based on ... cumulative file sizes with respect to total file size of this folder I tried it manually by hand on Victor Hugo's 'Les Miserables' (about 2500 print pages) and it works within +/- 3%

I'll try to write a little PC script (when I find enough free time) to pre-process mobi7 and mobi8 files to extract TOC entries' positions.
It occured to me that in KOReader there is the OCR-looking-up-dictionary feature, so, when there have already been the xx% hint at the bottom while reading, you may as well capture the screen, and cut out the numbers from the picture file, then use tesseract to get the progress?

However, one of the drawbacks is you must enable the reading progress display, so there's no way to get locations/progress from the screen directly.

Let me have a try.

Last edited by PromethiumL; 01-29-2019 at 05:22 AM.
PromethiumL is offline   Reply With Quote
Old 01-29-2019, 11:12 AM   #12
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
Yeah, I was thinking about that method. E. g. To make a script capture all chapter numbers while I am scrolling through TOC on Kindle. But that's too straightforward
mergen3107 is offline   Reply With Quote
Old 01-25-2020, 12:45 AM   #13
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
I am on my way to finish this little project.

Sorry for a dumb question, but I can't declare an array in a script:
Code:
#!/bin/sh
vlocstep=(10 12)
The PuTTy terminal simply says " syntax error: unexpected "(" "

What am I doing wrong?
I need many arrays to input chapter locations. I am trying to write a script to launch from KUAL.
Should I just write everything in python?
mergen3107 is offline   Reply With Quote
Old 01-25-2020, 03:09 AM   #14
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 415
Karma: 750442
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
try adding
Code:
declare -a vlocstep
before using it
encol is offline   Reply With Quote
Old 01-25-2020, 11:31 AM   #15
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,046
Karma: 3000024
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
@encol,
I tried that too, but it says that command is not found.

So, I found this thread, and apparently Kindles have busybox instead of true bash. There is a compiled version of true bash that works for me for now

I know it is a little old, but I hope it will work for DrawgressBar basic needs.
mergen3107 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
xmahjongg for Kindle as Kual extension Hanspeter Kindle Developer's Corner 86 12-02-2016 07:06 PM
kual extension to open a book shoelesshunter Kindle Developer's Corner 14 08-16-2016 12:30 PM
Is there a Kual Extension/add-on for cloud eduardomb Kindle Developer's Corner 19 07-08-2016 05:43 PM
is there any KUAL extension development guide? fangzi Kindle Developer's Corner 2 01-02-2014 10:11 AM


All times are GMT -4. The time now is 06:56 AM.


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