08-14-2016, 08:34 AM | #1 |
copyleft librarian
Posts: 58
Karma: 10
Join Date: Nov 2015
Device: KV
|
kual extension to open a book
how would I go about inserting a menu item into KUAL that would simply open a particular title?
my aim is to place a Calibre generated catalog where I can easily access it. I am using a Voyage on 5.6.5 thanks. |
08-14-2016, 08:55 AM | #2 |
Evangelist
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Well, well.. I too was thinking along the same lines..!
I'm sure it can be done with one of those "lipc" commands. I don't know enough about those. What would be more interesting is to make the command use KOReader for pdfs, djvus and other formats which the inbuilt reader can't handle well. Also, I think Aeris's Kindle menu could also do the job and show the book covers too! |
08-14-2016, 09:14 AM | #3 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
That wheel is already invented.
See: KPVbooklet and of course, its source code. |
08-15-2016, 01:43 AM | #4 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
To start a Kindlet:
Code:
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.kindlet/mnt/us/path/to/kindlet.azw2 Not sure why anyone wants that though. KindleMenu uses it to launch Kindlets that are otherwise hidden from cluttering your library list. And KPVBooklet already handles alternative filetypes to be listed in the library list and opened through KOReader. How much utility is gained from opening a catalog book straight through a KUAL extension, anyway? It is not like books are hard to find (but if they are, you might have bigger problems -- namely, organization). |
08-15-2016, 02:41 AM | #5 |
copyleft librarian
Posts: 58
Karma: 10
Join Date: Nov 2015
Device: KV
|
No, not hard to find, but I thought it would be neat to have a "catalog button" handy, and I couldn't think of where else to put that than in a KUAL extension. Sounds corny, but I'm taking baby steps here.
|
08-15-2016, 03:33 AM | #6 |
Evangelist
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Eshwartz, Request you to give the lipc commands to open a book with:
1. The built-in reader 2. KOReader Yes, You're right about organisation problems with large number of books. I tried using the nested collections feature of Collections manager. But you can't back out from a nested collection. You have to go back home every time. You could also use the search feature. Here, too there are some issues: the indexer sometimes doesn't show a book; You also have to remember some part of the book title! So, using lipc commands with KUAL may be a solution. I assume KUAL allows nesting of commands to a reasonably deep level. This way you could create categories like fiction, history, science, etc. Another option would be to have a html page with links that open each book. I believe this could be done with a browser or waf(don't know enough about this). |
08-15-2016, 12:32 PM | #7 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I don't use KOReader, sorry.
As for the builtin reader, I have tested it and sure enough you can use "reader" instead of "kindlet" and it will open a document in the builtin reader. Works: Code:
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.reader/mnt/us/documents/Warbreaker_B002KYHZHA.azw3 But what I have not been able to figure out is, how to inform lipc about a filepath containing spaces. I have tried standard shell escaping, and using quotes. Both return the standard "the application could not be started" message. |
08-15-2016, 12:55 PM | #8 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
@eschwartz: NiLuJe recently had to deal with spaces in titles for the screensaver app. Whatever he did should be among the recent changes in his public repo. Last edited by knc1; 08-15-2016 at 12:57 PM. |
|
08-15-2016, 02:24 PM | #9 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I don't see anything useful.
Although trying to find things via the repo browser is not always fun, less so when it is SVN you are talking about, and I can't figure out how to clone it, and basically, SVN. So maybe I just missed it. Because trac is kind of awkward anyway. It's not a big deal -- if it is really important to open a specific ebook using lipc, just make sure that ebook has no complexity-inducing spaces in the filename. |
08-15-2016, 04:25 PM | #10 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Ah, but wait - this is a UTF-8 based device.
Maybe those blanks in the path and file names are not an ASCII space but a something (UTF-8) that just looks the same. The kernel's FAT-32 driver may be making some sort of conversion along the way. |
08-15-2016, 06:11 PM | #11 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Well, the spaces I was using were definitely ASCII spaces, since I created the files in question to begin with.
I'd be more motivated to try to find out if there is a solution, if it were a practical problem to begin with. As it is, for the unusual event where you wish to launch an ebook via a static KUAL entry, you can just use a decent filename (spaces are eeeeevil!!) |
08-15-2016, 06:26 PM | #12 | |||
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
Quote:
So you need to URI encode the filename. For example, replacing spaces with "%20" worked for me on this file: Quote:
path-absolute = "/" [ segment-nz *( "/" segment ) ] and ... and pchar = unreserved / pct-encoded / sub-delims / ":" / "@" unreserved is whats listed on wikipedia sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" https://en.wikipedia.org/wiki/Percent-encoding https://tools.ietf.org/html/rfc3986 After that, a simple script can do - In the regex, just put all the character that should be allowed - for example, we know that the backslashes are fine, and commas worked for me.: Quote:
/mnt/us/documents/Hunted_%20The%20Iron%20Druid%20Chronicles,%20Book% 20Six_B00AUSCOIS.kfx But if a file has that '/' character in it, this wont work, it will treat it as a new directory segment. Last edited by coplate; 08-15-2016 at 06:54 PM. |
|||
08-15-2016, 09:28 PM | #13 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I vaguely suspected urlencoding might work. But I wasn't about to test it unless I had a motivation to do so manually typing things (without bash filename completion) gets increasingly awkward without copy-paste and on a small touchscreen.
So, good of you to find out for us. For however useful it is to ensure pre-existing, stable filenames embedded in a script can be embedded with spaces in them. ... Also, it is probably both more efficient and more portable to do it all in awk: https://gist.github.com/moyashi/4063894 |
08-16-2016, 12:26 PM | #14 | |
Evangelist
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Quote:
Both opened fine. I gave the command both from a ssh session from my PC as well as from kterm. Both times, it worked. ... ... BUT... It seems to have screwed up kterm in some way. Either kterm doesn't start OR it starts but the on screen keyboard is unresponsive. Needs a restart to set things right. Any way around this? {KT3W, G000KA, 5.8.0} Last edited by nasser; 08-16-2016 at 12:28 PM. Reason: Added my kindle specs |
|
08-16-2016, 12:30 PM | #15 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Huh, that is quite bizarre, and true.
I haven't the foggiest clue why though. Actually, what I noticed is that it only shows that when I don't open kterm using the KUAL menuentry. Which explains why I didn't initially notice. Even after opening with KUAL... if I try opening kterm using Aeris' KindleMenu or via a custom search bar command, the keyboard is wonky. |
Tags |
calibre, jailbreak, kual |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CPU Governor Menu (KUAL extension) | knc1 | Kindle Developer's Corner | 41 | 09-16-2021 02:54 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 |