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-21-2013, 08:51 AM   #76
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by DuckieTigger View Post
Oh, as far as kterm is concerned - no more problem going to sleep with it. When Kindle wakes up, it goes back to the kterm. So that helper to kill all kterm can be removed.

As far as the closing on everything goes, meh. It might be a good idea to have it by default close on launch, but please make it optional so we can keep the launcher alive. Well if that is not too much work :P
I already did that. Version 2 helper has reduced options.

Looking at adding a checkbox type to the UI. (see above TODO)
twobob is offline   Reply With Quote
Old 01-21-2013, 09:28 AM   #77
stepk
Groupie
stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
parse.sh

Quote:
Originally Posted by twobob View Post
If you jump inside it you can see that it welds items back into the MENU system via Yifan orignal menuable wangle.

So really the question should be: could we implement an autocreated list that does much the same thing. but for our menu. Answer: probably. But since I don't even use HUR... it's not high on my personal list. it would be a case of iterating over "something" and spitting out the right param list. also totally doable.

On the "Nice To Have" List. Okay?
Fine on the NTH list. Just for fun I did jump inside the bit bucket at parse.sh and stopped right there in contemplation. I noticed the statements that parse menu.json; they look very similar and complicated, I think they could be simplified. Can I show an example here?
Spoiler:

Given data
Code:
...
         {"name": "Portrait", "priority": 0, "action": "bin/setorientation.sh", "params": "U"},
...
instead of using the bitbucket code below to grab "action"
Code:
for z in $(cat $j | sed -e 's/[{}]/''/g' \
| awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' \
| sed 's/\"\:\"/\|/g;s/[\,]/ /g;s/\"//g'| grep "action" | grep -w " action") 
do
which outputs
Code:
   action: bin/setorientation.sh
you could use
Code:
for z in $(sed -ne 's/^.*"\(action\)"\(\s*:\s*\)"\([^"]\+\)".*$/\1\2\3/p' < $j); do
which outputs - just like the current code, save for an initial space character
Code:
action: bin/setorientation.sh
Similar code could be applied for "params" etc.

Last edited by stepk; 01-21-2013 at 09:44 AM. Reason: make output fully compatible with the format that the current downstream code expects
stepk is offline   Reply With Quote
Advert
Old 01-21-2013, 09:41 AM   #78
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
the code is being refactored by Ixtab as we speak. I promisd not to make changes for 24 hours to the GIT. that said. if you have a tidier (and you seemingly do) way of grabbing out the values you want to see in labels.

Then provide the code. the bits to grab whatever section you want.
Bear in mind in places there may be multiple interations going on.
As long as adding a call for a label doesn't affect the total looping then fine.
basically whatever you want adding has to just "drop in".

But I assume you are running ./parse.sh manually and checking the output. Do do that.

When the time comes I will add those as options to the button label generator code.
possibly tomorrow assuming you come up with the goods you want amending. Tested.

Can't say fairer than that. Thanks for having a look. I'll add it in if you do your bit.

It can easily be improved upon I never pretended to be a great programmer

Last edited by twobob; 01-21-2013 at 09:46 AM.
twobob is offline   Reply With Quote
Old 01-21-2013, 09:50 AM   #79
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
## Parse the JSON best we can using a shell. Ditch various bit we aren't concerned with. Only return the action nodes' values
for z in $(sed -ne 's/^.*"\(action\)"\(\s*:\s*\)"\([^"]\+\)".*$/\1\2\3/p' < $j); do
tests as fine.

Feel free to improve the rest
twobob is offline   Reply With Quote
Old 01-21-2013, 11:32 AM   #80
DuckieTigger
Wizard
DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.
 
DuckieTigger's Avatar
 
Posts: 4,742
Karma: 246906703
Join Date: Dec 2011
Location: USA
Device: Oasis 3, Oasis 2, PW3, PW1, KT
fixed

Last edited by DuckieTigger; 01-21-2013 at 06:44 PM.
DuckieTigger is offline   Reply With Quote
Advert
Old 01-21-2013, 02:04 PM   #81
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by DuckieTigger View Post
Please double check your helper v2 tarball. I made the mistake in not downloading both, the zip has the v2 for menu.json (the kill-kterm.sh still in /bin, no entry in menu.json). Ok here some printout from my Kindle:
Code:
[root@kindle extensions]# ls -la helper.V.0.*
-rwxr-xr-x    1 root     root          1327 Jan 20 14:48 helper.V.0.1.tar.gz
-rwxr-xr-x    1 root     root          1327 Jan 21 11:15 helper.V.0.2.tar.gz
[root@kindle extensions]# diff -s helper.V.0.1.tar.gz helper.V.0.2.tar.gz
Files helper.V.0.1.tar.gz and helper.V.0.2.tar.gz are identical
[root@kindle extensions]# tar -tvf helper.V.0.2.tar.gz
blah
[root@kindle extensions]#
And I just downloaded them fresh again both zip and tarball.
Yeah okay. I just adjusted them by hand after no longer needing the kterm.sh to be linked in.

will tidy up for next time, I'm not sure what was supposed to be missing but if its critical I'll fix it. Thanks
twobob is offline   Reply With Quote
Old 01-21-2013, 02:16 PM   #82
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
Signature Files

Since gnupg tools really don't care about the extension, just the header . . .

Since the *.asc (ascii armor version for posting on 'net) is indeed a text file . . .

Until the forum post attachment filter is fixed to allow *.asc, just rename them *.txt - that should work for now anyway.

The end-users only need one copy of the author's gpg key -
Which they can get here:
http://drpbox.knetconnect.com/mr-keys/

Those are the "ascii armor" version of each author's public key.

@twobob: When fixing up the top post attachements you can remove that key file from the signatures zip file - no longer needed there now. thanks.
knc1 is offline   Reply With Quote
Old 01-21-2013, 06:43 PM   #83
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by knc1 View Post
Since gnupg tools really don't care about the extension, just the header . . .

Since the *.asc (ascii armor version for posting on 'net) is indeed a text file . . .

Until the forum post attachment filter is fixed to allow *.asc, just rename them *.txt - that should work for now anyway.

The end-users only need one copy of the author's gpg key -
Which they can get here:
http://drpbox.knetconnect.com/mr-keys/

Those are the "ascii armor" version of each author's public key.

@twobob: When fixing up the top post attachements you can remove that key file from the signatures zip file - no longer needed there now. thanks.
Understood.

Thanks
twobob is offline   Reply With Quote
Old 01-21-2013, 07:59 PM   #84
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
@DuckieTigger.
Perhaps you are reading something in my post I did not.?

Quote:
the kill-kterm.sh still in /bin, no entry in menu.json
Apologies for any miscommunication. I only just noticed you did actually put what the error was duh... I was trying to say "what's wrong?" but life got in the way

EDIT: Ah right the tar.gz had one of the menus with an extra entry and a mislabelled header. Thanks. I missed that. The perils of manual editing.

Appreciate the assist.

Last edited by twobob; 01-21-2013 at 08:39 PM. Reason: Found the mistakes. duh.
twobob is offline   Reply With Quote
Old 01-22-2013, 05:15 AM   #85
stepk
Groupie
stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
Lightbulb aloop.sh

twobob, I can't offer a pluggable replacement, I worked on an alternative parsing approach instead. The attached aloop.sh should more or less replace parse.sh with some plumbing on your part. It should be easy for you, easier than my trying to second guess some parts of parse.sh.
aloop.sh uses no external commands to parse json data. It's all pure shell. It's fast. It's here for your take. No offense taken if you turn it down.
If you want I could work on interfacing this module to downstream code, but I probably need some overall design info/documentation - I don't want to guess what you and ixtab have in mind.
File aloop.sh is the script. Instructions at top of file.
File aloop.out shows a run on my extensions folder - the list of parsed json/xml data as a set of sh variables.

P.S. helper/menu.json 411 entry has a typo, a [ instead of a {
Attached Files
File Type: zip aloop.zip (2.8 KB, 411 views)

Last edited by stepk; 01-22-2013 at 05:19 AM. Reason: attach files
stepk is offline   Reply With Quote
Old 01-22-2013, 06:21 AM   #86
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Ah cool work you.

Will give this a workout. Much obliged!!

EDIT: Updated the helpers to not have bad bracket. thanks.

Last edited by twobob; 01-22-2013 at 07:27 AM.
twobob is offline   Reply With Quote
Old 01-22-2013, 07:41 AM   #87
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 stepk View Post
twobob, I can't offer a pluggable replacement, I worked on an alternative parsing approach instead. The attached aloop.sh should more or less replace parse.sh with some plumbing on your part. It should be easy for you, easier than my trying to second guess some parts of parse.sh.
aloop.sh uses no external commands to parse json data. It's all pure shell. It's fast. It's here for your take. No offense taken if you turn it down.
If you want I could work on interfacing this module to downstream code, but I probably need some overall design info/documentation - I don't want to guess what you and ixtab have in mind.
File aloop.sh is the script. Instructions at top of file.
File aloop.out shows a run on my extensions folder - the list of parsed json/xml data as a set of sh variables.

P.S. helper/menu.json 411 entry has a typo, a [ instead of a {
In jason_parse()
Define: local IFS

Which should be supported in ASH, same as in BASH although I did not test it in Kindle-Busybox builds.
knc1 is offline   Reply With Quote
Old 01-22-2013, 08:11 AM   #88
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
thanks Knc! read over...
http://bash.cyberciti.biz/guide/$IFS and some of http://tldp.org/LDP/abs/html/

and did
Quote:
json_parse () {
local IFS line implode prev s x v menu=$1 foo=$2
much obliged to both of you : D

Last edited by twobob; 01-22-2013 at 08:16 AM.
twobob is offline   Reply With Quote
Old 01-22-2013, 08:21 AM   #89
stepk
Groupie
stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
Quote:
Originally Posted by knc1 View Post
In jason_parse()
Define: local IFS

Which should be supported in ASH, same as in BASH although I did not test it in Kindle-Busybox builds.
Define as local what for? I mean what's your concern if it isn't defined as local? IFS is a special shell variable, local or global it affects the way sh works. Note that json_parse sets it the resets to its default value when it's finished.
stepk is offline   Reply With Quote
Old 01-22-2013, 08:33 AM   #90
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Fair enough.

I do have one question.

for $json_action I was ensuring before that all paths were fully Qualified by checking for the existence of $1 (/mnt/us/extensions/<appname>) and adding it if missing... would that be a quick fix?

Other than that I am ready to drop this in for testing.


EDIT: so to confirm what I mean there $json_action should always return the fully qualified path. Many many thanks.
twobob is offline   Reply With Quote
Reply

Tags
kindle touch, kindle touch hacks, kindlet, kual, launcher, launcher add-ons, paperwhite, sqlite, unified

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Launcher icon for KUAL? Aeris Kindle Developer's Corner 32 04-01-2021 07:57 PM
kite: kindle 3 application launcher fbdev Kindle Developer's Corner 86 10-18-2017 10:19 AM
[KUAL]Kindle reflective screen loader icantbebothered Kindle Developer's Corner 26 10-27-2013 09:08 AM
Kual shortcut for hidden image viewer (Kindle Touch & PW) Aeris Kindle Developer's Corner 0 10-12-2013 05:09 AM
application launcher for kindle 3 (kite) fbdev Kindle Developer's Corner 21 05-04-2012 06:02 PM


All times are GMT -4. The time now is 04:39 PM.


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