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-22-2013, 03:38 PM   #106
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: 164
Karma: 593450
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
aloop.sh rev 3

Here we go, I think I added all of kc1's suggestions, and took care of twobob's requests. The labels are cleanup up a bit, with some ugly characters removed and spaces coalesced. As label format I chose "xml_name.json_name" when they differ, or simply "json_name" when they coincide. See aloop.out.

edit: version bump 20130122,c
- adds sort option (aloop.sh -s)
- adds TouchRunner compatible output option (aloop.sh -f=touchrunner)
Attached Files
File Type: zip aloop-20130122c.zip (3.5 KB, 75 views)

Last edited by stepk; 01-22-2013 at 05:23 PM. Reason: version bump
stepk is offline   Reply With Quote
Old 01-22-2013, 05:25 PM   #107
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: 164
Karma: 593450
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
version bump 20130122,c post #106
this version adds a TouchRunner compatible output option, ref. http://www.mobileread.com/forums/sho...&postcount=297.
TouchRunner seems to be very similar to Kindle Launcher in this thread. It's an active content book, it reads its menu from /mnt/us/touchrunner/commands.txt, and displays up to 12 labels on a single page, whilst Kindle Launcher displays up to 30.

I think 12 isn't enough, and 30 isn't that many. Since neither menu can be nested it's easy to run out of entries. Consider that Komic alone adds 6 or 7 entries to yfanlu's menu. Can an active content book be made to scroll? Maybe by defining page bookmarks and navigating via GoTo?

Last edited by stepk; 01-22-2013 at 05:37 PM.
stepk is offline   Reply With Quote
Old 01-22-2013, 06:01 PM   #108
knc1
Helpdesk Junkie
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: 6,689
Karma: 5850008
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by stepk View Post
version bump 20130122,c post #106
this version adds a TouchRunner compatible output option, ref. http://www.mobileread.com/forums/sho...&postcount=297.
TouchRunner seems to be very similar to Kindle Launcher in this thread. It's an active content book, it reads its menu from /mnt/us/touchrunner/commands.txt, and displays up to 12 labels on a single page, whilst Kindle Launcher displays up to 30.

I think 12 isn't enough, and 30 isn't that many. Since neither menu can be nested it's easy to run out of entries. Consider that Komic alone adds 6 or 7 entries to yfanlu's menu. Can an active content book be made to scroll? Maybe by defining page bookmarks and navigating via GoTo?
Nested menus are on the "to do" list.
It was Komic that demonstrated a need for them.
knc1 is offline   Reply With Quote
Old 01-22-2013, 07:57 PM   #109
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,552
Karma: 6021142
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 stepk View Post
version bump 20130122,c post #106
this version adds a TouchRunner compatible output option, ref. http://www.mobileread.com/forums/sho...&postcount=297.
TouchRunner seems to be very similar to Kindle Launcher in this thread. It's an active content book, it reads its menu from /mnt/us/touchrunner/commands.txt, and displays up to 12 labels on a single page, whilst Kindle Launcher displays up to 30.

I think 12 isn't enough, and 30 isn't that many. Since neither menu can be nested it's easy to run out of entries. Consider that Komic alone adds 6 or 7 entries to yfanlu's menu. Can an active content book be made to scroll? Maybe by defining page bookmarks and navigating via GoTo?
Mind reading.

In hand.


EDIT: Huge thanks
twobob is offline   Reply With Quote
Old 01-23-2013, 01:18 AM   #110
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
I've found a way to run KindleLauncher with swipe over Menu button. Tested on Kindle Touch 5.3.2.

Run provided shell script (make sure launcherPath is set to path of your KindleLauncher) and then swipe over Menu button in search bar, starting from top or right. It works even in browser. It will work until Pillow restart, so it's enough to run script only once after reboot.

Simple press on Menu button will work as usual.

It's possible to implement toggling of this additional functionality without reloading of Pillow, but ATM disabling isn't implemented and could be done only with restart pillow (UPD: toggling is implemented in another version made for using in Upstart script). This script is a simple POC, so there could be also other quirks.
Spoiler:
Code:
SCRIPT=`cat << 'JAVASCRIPT' | tr -d '\n' | sed -e 's,",\\\\",g'
(function () {
  var launcherPath = "/mnt/us/documents/KindleLauncher-2.0.azw2";

  var menuButton = document.getElementById("menu");
  var swiped = false;
  var launcherApp = "file://" + launcherPath;

  menuButton.addEventListener("mousedown", function () {
    swiped = true;
  });
  menuButton.addEventListener("mouseup", function () {
    swiped = false;
  });

  document.body.addEventListener("mouseout", function () {
    if (swiped) {
      swiped = false;
      nativeBridge.setLipcProperty(
        "com.lab126.appmgrd",
        "start",
        launcherApp
      );
    }
  });
})();
`

MESSAGE='{
  "__id__":   "0",
  "pillowId": "search_bar",
  "replySrc": "",
  "function": "'${SCRIPT}'"
}'

lipc-set-prop -s com.lab126.pillow interrogatePillow "$MESSAGE"

Last edited by eureka; 01-09-2014 at 07:53 PM. Reason: link to another script version
eureka is offline   Reply With Quote
Old 01-23-2013, 02:36 AM   #111
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: 164
Karma: 593450
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
improved sh?

Quote:
Originally Posted by eureka View Post
I've found a way to run KindleLauncher with swipe over Menu button. Tested on Kindle Touch 5.3.2.
This is exciting! I don't have my KT with me right now so I can't test it, will do. Meanwhile I noticed how to speed it up (on my Windows PC by a factor of about 20) by eliminating the sh line that squeezes $SCRIPT. Note that I reversed the role of single and double quotes! Please try this script (untested on KT, tested on Windows busybox)
Spoiler:
Code:
#!/bin/sh - 

set -o nounset # Treat unset variables as an error
set -f # No filename expansion

# note: misprints lines that start with '-n'
SCRIPT=$(while read line; do echo -n ${line//$'\"'/$'\"'}; done << 'JAVASCRIPT'
(function () {
  var launcherPath = "/mnt/us/documents/KindleLauncher-2.0.azw2";

  var menuButton = document.getElementById("menu");
  var swiped = false;
  var launcherApp = "file://" + launcherPath;

  menuButton.addEventListener("mousedown", function () {
    swiped = true;
  });
  menuButton.addEventListener("mouseup", function () {
    swiped = false;
  });

  document.body.addEventListener("mouseout", function () {
    if (swiped) {
      swiped = false;
      nativeBridge.setLipcProperty(
        "com.lab126.appmgrd",
        "start",
        launcherApp
      );
    }
  });
})();
JAVASCRIPT
exit
)

MESSAGE='{
  "__id__":   "0",
  "pillowId": "search_bar",
  "replySrc": "",
  "function": "'${SCRIPT}'"
}'

lipc-set-prop -s com.lab126.pillow interrogatePillow "$MESSAGE"

Last edited by stepk; 01-23-2013 at 06:37 AM. Reason: changed script to preserve double-quoting style
stepk is offline   Reply With Quote
Old 01-23-2013, 03:06 AM   #112
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by stepk View Post
Note that I reversed the role of single and double quotes!
No, thanks. I enjoy my double quotes in JavaScript code.

(Just a joke. However, double quotes are syntactically valid in JavaScript, so remembering to avoid or to escape them could be mentally painful.)

EDIT: just realized that my original code didn't handle single quotes in JavaScript as expected. Fixed.

Last edited by eureka; 01-23-2013 at 03:49 AM.
eureka is offline   Reply With Quote
Old 01-23-2013, 03:11 AM   #113
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 698
Karma: 1545625
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Another nice way to run the launcher is using the store button.
Just use this tweak placing:

Code:
file:///mnt/us/documents/KindleLauncher-2.0.azw2
(or any other path)
instead of:

Code:
app://com.lab126.store
Personally I use this to run Komic, but I tried with the launcher and it works.

Someone could also join the two things together and use the tap/swipe gesture to run launcher/something else.

(Amazon "obfuscated" the searchbar.js file, but what's needed it easily findable).

PS So it's time to make a nice 67x67px icon for the launcher...
silver18 is online now   Reply With Quote
Old 01-23-2013, 03:27 AM   #114
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by silver18 View Post
Another nice way to run the launcher is using the store button.
Well, my script does it's work completely in runtime and doesn't change any system files. In fact, it should be possible also to change Store button icon and action in this way without editing of search_bar.js.
eureka is offline   Reply With Quote
Old 01-23-2013, 03:32 AM   #115
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 698
Karma: 1545625
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
True, I didn't read it carefully!
Personally I prefer using the store button as I never use the store itself!
Anyway that's a nice way to have the launcher always there to be used!!
silver18 is online now   Reply With Quote
Old 01-23-2013, 04:15 AM   #116
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: 164
Karma: 593450
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
Quote:
Originally Posted by eureka View Post
EDIT: just realized that my original code didn't handle single quotes in JavaScript as expected. Fixed.
I can't find the closing 'JAVASCRIPT' token.
stepk is offline   Reply With Quote
Old 01-23-2013, 04:29 AM   #117
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by stepk View Post
I can't find the closing 'JAVASCRIPT' token.
I didn't put it. But it works on KT!
eureka is offline   Reply With Quote
Old 01-23-2013, 05:24 AM   #118
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: 164
Karma: 593450
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
Quote:
Originally Posted by eureka View Post
I didn't put it. But it works on KT!
Maybe I'm doing something wrong, but on KT 5.1.2 when I swipe over the Menu button nothing happens. I do see that the button flashes as I swipe over it. I did check that the path to KindleLauncher az2 is correct.

P.S. I updated my mod to escape double quotes so you need not change your quoting style
stepk is offline   Reply With Quote
Old 01-23-2013, 07:11 AM   #119
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,552
Karma: 6021142
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
Right. Thanks to all. Having a look now at these things. Super awesome as ever.

Thanks!!!
twobob is offline   Reply With Quote
Old 01-23-2013, 07:33 AM   #120
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,552
Karma: 6021142
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 stepk View Post
Maybe I'm doing something wrong, but on KT 5.1.2 when I swipe over the Menu button nothing happens.
Hmm. That's a good point. I don't have a device (of each point release) to check the implementation of this for each (for each point release)

perhaps I will rollback my device later to check that out.

I can confirm it working on the 5.3.2

Excellent appreciation nevertheless.

Quote:
P.S. I updated my mod to escape double quotes so you need not change your quoting style
Do I have that? thanks
I'll play around with aloop-20130122c in the interim.

Last edited by twobob; 01-23-2013 at 07:37 AM.
twobob is offline   Reply With Quote
Reply

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kite: kindle 3 application launcher fbdev Kindle Developer's Corner 80 07-24-2014 10:44 AM
Launcher icon for KUAL? Aeris Kindle Developer's Corner 20 11-27-2013 01:03 PM
Tools [KUAL]Kindle reflective screen loader icantbebothered Kindle Developer's Corner 26 10-27-2013 09:08 AM
K5 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 10:21 AM.


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