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: 5,109
Karma: 5288897
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW, K5 B011, K3 us, K4, DXG, XDA I&II, Omnia, Ematic E6 + E8 :) etc.
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:	152
Size:	27.2 KB
ID:	100448   Click image for larger version

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

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

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

Name:	ImageMagick: root.fb.pgm_062.png
Views:	167
Size:	30.3 KB
ID:	100452  
__________________
Audiophile and electron bully.
My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK
Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him.
The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set

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