View Single Post
Old 02-01-2013, 07:12 AM   #5
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
Worked Example of refactoring a launchpad script to KUAL

Where are we?

[root@kindle launchpad]# pwd
Quote:
/mnt/us/launchpad
Let's look at what we want to port to KUAL
[root@kindle launchpad]# cat kpdf.ini
Quote:
[Actions]
# start kindlepdfviewer with filebrowser in /mnt/us/documents
P D = !/mnt/us/kindlepdfviewer/kpdf.sh /mnt/us/documents
# start kindlepdfviewer with last document
P P = !/mnt/us/kindlepdfviewer/kpdf.sh
# start kindlepdfviewer without framework in /mnt/us/documents
P K = !/mnt/us/kindlepdfviewer/kpdf.sh --framework_stop /mnt/us/documents
# start kindlepdfviewer without framework on last read document
P L = !/mnt/us/kindlepdfviewer/kpdf.sh --framework_stop
# restart amazon framework - when it got irritated
P R = !/etc/init.d/framework restart
so we need to grab out the .sh and refactor the calls to KUAL buttons.

Let's make a directory:
[root@kindle launchpad]# mkdir -p /mnt/us/extensions/kpdf/bin

copy out that shell script
[root@kindle launchpad]# cp ./kpdf.sh /mnt/us/extensions/kpdf/bin/

Convert Launchpad commands to other Launcher commands in menu.json

Code:
{
"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"}
]
}
]
}
[TABS FLATTENED FOR EASE OF READING]
(I did two for now.)

update config.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<extension>
	<information>
		<name>KPDF</name>
		<version>0.0</version>
		<author>Hawhill</author>
		<id>helper</id>
	</information>
	<menus>
		<menu type="json" dynamic="true">menu.json</menu>
	</menus>
</extension>
To Be Continued... seems to work fine.

Just extract the kpdf.zip in /mnt/us/extensions/
(oh and install the pre-requisites and then The Kual Kindlet itself) LINK REMOVED AS IT WAS ALREADY STALE!
Go get the latest version from the thread

remember to check you have the latest versions (these links get old) by visiting The Main KUAL Thread. Cheers

EDIT:

FOR FULL DETAILS OF KPDF SUPPORT IN KUAL PLEASE VISIT IT'S SUPPORT PAGES
Attached Thumbnails
Click image for larger version

Name:	ImageMagick: root.fb.pgm_057.png
Views:	1044
Size:	27.2 KB
ID:	100448   Click image for larger version

Name:	ImageMagick: root.fb.pgm_059.png
Views:	1668
Size:	22.4 KB
ID:	100449   Click image for larger version

Name:	ImageMagick: root.fb.pgm_060.png
Views:	1050
Size:	24.6 KB
ID:	100450   Click image for larger version

Name:	ImageMagick: root.fb.pgm_061.png
Views:	1259
Size:	26.9 KB
ID:	100451   Click image for larger version

Name:	ImageMagick: root.fb.pgm_062.png
Views:	971
Size:	30.3 KB
ID:	100452  

Last edited by twobob; 02-17-2013 at 11:31 PM. Reason: TBC
twobob is offline   Reply With Quote