View Single Post
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: 741
Karma: 2345678
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