From 0709fdfe4e75c8fdaae9393032b8da2b5e79c038 Mon Sep 17 00:00:00 2001 From: Twobob Date: Sat, 9 Feb 2013 19:26:25 +0000 Subject: [PATCH] KUAL extensions added (since kindlepdfviewer will soon support all devices) --- extensions/kpdf/README.txt | 23 +++++++++++++++++++++++ extensions/kpdf/bin/kpdf.sh | 37 +++++++++++++++++++++++++++++++++++++ extensions/kpdf/config.xml | 12 ++++++++++++ extensions/kpdf/kpdf.sh | 37 +++++++++++++++++++++++++++++++++++++ extensions/kpdf/menu.json | 12 ++++++++++++ 5 files changed, 121 insertions(+) create mode 100644 extensions/kpdf/README.txt create mode 100755 extensions/kpdf/bin/kpdf.sh create mode 100755 extensions/kpdf/config.xml create mode 100755 extensions/kpdf/kpdf.sh create mode 100755 extensions/kpdf/menu.json diff --git a/extensions/kpdf/README.txt b/extensions/kpdf/README.txt new file mode 100644 index 000000000..d56e92cc9 --- /dev/null +++ b/extensions/kpdf/README.txt @@ -0,0 +1,23 @@ +TITLE: kindlepdfviewer + +CONTAINS: KUAL files for installation in /mnt/us/extensions/ + +REF: Main KUAL thread http://www.mobileread.com/forums/showthread.php?t=203326 + +UPSTREAM SOURCE: https://github.com/hwhw/kindlepdfviewer + +SUPPORTS: +DX Yes ( All Revisions ) +K3 Yes ( All Revisions ) +K4 Yes ( All Revisions ) +Touch (check github and threads for support information) +PW (check github and threads for support information) + +REQUIRES: KindlePDFviewer http://www.mobileread.com/forums/showthread.php?t=157047 + +ARCHIVAL LINK: http://www.mobileread.com/forums/showpost.php?p=2406316&postcount=5 + +ORIGINAL AUTHOR: Hawhill, See GIT for subsequent contributors listing + +NOTES: Touchscreen support for the Touch and PW is in progress +check github and threads for support information diff --git a/extensions/kpdf/bin/kpdf.sh b/extensions/kpdf/bin/kpdf.sh new file mode 100755 index 000000000..c1f81c700 --- /dev/null +++ b/extensions/kpdf/bin/kpdf.sh @@ -0,0 +1,37 @@ +#!/bin/sh +export LC_ALL="en_US.UTF-8" + +echo unlock > /proc/keypad +echo unlock > /proc/fiveway + +# we're always starting from our working directory +cd /mnt/us/kindlepdfviewer/ + +# bind-mount system fonts +if ! grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then + mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host +fi + +# check if we are supposed to shut down the Amazon framework +if test "$1" == "--framework_stop"; then + shift 1 + /etc/init.d/framework stop +fi + +# stop cvm +killall -stop cvm + +# finally call reader +./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log + +# unmount system fonts +if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then + umount /mnt/us/kindlepdfviewer/fonts/host +fi + +# always try to continue cvm +killall -cont cvm || /etc/init.d/framework start + +# cleanup hanging process +killall lipc-wait-event + diff --git a/extensions/kpdf/config.xml b/extensions/kpdf/config.xml new file mode 100755 index 000000000..1d13b8853 --- /dev/null +++ b/extensions/kpdf/config.xml @@ -0,0 +1,12 @@ + + + + KPDF + 0.0 + Hawhill + helper + + + menu.json + + diff --git a/extensions/kpdf/kpdf.sh b/extensions/kpdf/kpdf.sh new file mode 100755 index 000000000..c1f81c700 --- /dev/null +++ b/extensions/kpdf/kpdf.sh @@ -0,0 +1,37 @@ +#!/bin/sh +export LC_ALL="en_US.UTF-8" + +echo unlock > /proc/keypad +echo unlock > /proc/fiveway + +# we're always starting from our working directory +cd /mnt/us/kindlepdfviewer/ + +# bind-mount system fonts +if ! grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then + mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host +fi + +# check if we are supposed to shut down the Amazon framework +if test "$1" == "--framework_stop"; then + shift 1 + /etc/init.d/framework stop +fi + +# stop cvm +killall -stop cvm + +# finally call reader +./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log + +# unmount system fonts +if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then + umount /mnt/us/kindlepdfviewer/fonts/host +fi + +# always try to continue cvm +killall -cont cvm || /etc/init.d/framework start + +# cleanup hanging process +killall lipc-wait-event + diff --git a/extensions/kpdf/menu.json b/extensions/kpdf/menu.json new file mode 100755 index 000000000..568d489f4 --- /dev/null +++ b/extensions/kpdf/menu.json @@ -0,0 +1,12 @@ +{ + "items": [ + { + "name": "KPDF", + "priority": 0, + "items": [ + {"name": "Start in documents", "priority": 1, "action": "bin/kpdf.sh", "params": "/mnt/us/documents"}, + {"name": "Open last document", "priority": 2, "action": "bin/kpdf.sh"} + ] + } + ] +}