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 -e /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 $1 - 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 -d "$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