View Single Post
Old 04-09-2013, 06:13 PM   #60
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
okay this is what I have

/media/Kindle/extensions/frotz/menu.json
Code:
{"items": [{
"name": "Frotz",
"priority": 1,
"items": [
{"name": "Start Frotz", "priority": 1, "action": "bin/start_frotz_shell.sh"}
]}]}


Which calls
/media/Kindle/extensions/frotz/bin/start_frotz_shell.sh

PHP Code:
#!/bin/sh
# export PATH=$PATH:/mnt/us/bin

# edit this so it includes where you keep your user binaries
export PATH=/mnt/us/extensions/kterm/bin:/mnt/us/extensions/frotz/bin:\
/
mnt/us/extensions/system/bin:\
/
mnt/us/extensions/system/bin/`uname -m`:\
/
mnt/us/extensions/system/bin/armv6l:$PATH

# I keep my binaries in the kterm path, meh the folder is there anyways why not?
# I also added in the frotz bin folder, no good reason it can't live there neither.
# For this example I will make them live in frotz/bin
# The other stuff is my kual-system stuff, you can ignore it

/mnt/us/extensions/kterm/bin/kterm -/mnt/us/extensions/frotz/bin/frotz_shell.sh 


so that RELIES on the binaries being somewhere "findable" in the $PATH and then...
calls kterm, which in turns calls frotz/bin/frotz_shell.sh... Let's have a look in there...

PHP Code:
#!/bin/sh
sleep 1 # wait a second

size=$(stty size# how big is our window?
set -- $size
h
=$(expr $12# figure out the height only
shift
w
=$(expr $@ - 4# figure out the width only

# edit this to point to where you store your IF story files (*.z5 etc)
export ZCODE_PATH=/mnt/us/extensions/frotz/if # <-- I shoved mine in there, why not?

# edit this to point to the dialog rc file
export DIALOGRC=/mnt/us/extensions/frotz/bin/.dialogrc # <-- And that lives in there too...

# here we call dialog (we set the path though so we are all good...) to get the FILE
# and then shove the absolute path to our "if"s, 
# height and width on the end as arguments to dialog

FILE=$(dialog --stdout --title "Select Interactive Fiction File:" --fselect $ZCODE_PATH$h $w )

clear  # Tidy that junk off our screen

if [ "$FILE!= "" ]; then # assuming we didn't select total junk carry on...
frotz -"$FILE# call frotz (we set the path though so we are all good...) with our shiny FILE
fi # we are done here 


And that's the ballgame.

EDIT: You will NEED some "IF" files. Details here https://www.mobileread.com/forums/sho...3&postcount=23
Attached Thumbnails
Click image for larger version

Name:	TightVNC: kindle:0.0_391.png
Views:	376
Size:	15.6 KB
ID:	104114   Click image for larger version

Name:	TightVNC: kindle:0.0_397.png
Views:	356
Size:	27.6 KB
ID:	104115   Click image for larger version

Name:	TightVNC: kindle:0.0_394.png
Views:	400
Size:	20.1 KB
ID:	104116   Click image for larger version

Name:	TightVNC: kindle:0.0_395.png
Views:	402
Size:	41.0 KB
ID:	104117   Click image for larger version

Name:	TightVNC: kindle:0.0_396.png
Views:	361
Size:	41.7 KB
ID:	104118  

Last edited by twobob; 04-10-2013 at 08:59 AM. Reason: shiny colour!
twobob is offline   Reply With Quote