Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-01-2016, 11:21 AM   #16
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
Quote:
Originally Posted by knc1 View Post
Re-read your script.
What is it suppose to do if the screen is NOT gt 600 pixels?

Hint: Right now, it is doing just what you told it to do if the test fails.
Right!
Copy & Paste is the best friend/worst enemy of a programmer
(I copied it from kterm.sh script)

then try this:
Code:
#!/bin/sh

EXPORT LD_LIBRARY_PATH=/mnt/us/local/lib

EXTENSION=/mnt/us/extensions/kterm


WIDTH=`xwininfo -root|grep Width|cut -d ':' -f 2`
# use wider keyboard layout for screen width greater than 600 px
if [ ${WIDTH} -gt 600 ]; then
  PARAM="-l ${EXTENSION}/layouts/keyboard-wide.xml -e /mnt/us/local/mc/bin/mc"
else
  PARAM="-e /mnt/us/local/mc/bin/mc"
fi

${EXTENSION}/bin/kterm ${PARAM}

# when started from launcher kterm doesn't kill keyboard (why?) so:
killall matchbox-keyboard
if you launch from kterm:
Code:
/mnt/us/local/mc/bin/mc
mc is loaded?

Last edited by encol; 09-01-2016 at 11:23 AM.
encol is offline   Reply With Quote
Old 09-01-2016, 11:21 AM   #17
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by knc1 View Post
Re-read your script.
What is it suppose to do if the screen is NOT gt 600 pixels?

Hint: Right now, it is doing just what you told it to do if the test fails.
knc1, this is just a modification of baf's original kterm KUAL script.

If the screen width is NOT gt 600, then it uses the default "keyboard.xml" file, along with associated images in the img/ folder.

If the screen width IS gt 600(original logic to detect the then new PW1), then the "keyboard-wide.xml" file, along with the associated images(bigger) in the img-wide/ folder is used. These files are also used for the latest 300 ppi kindles, but we actually need a new "keyboard-extrawide.xml" file!
nasser is offline   Reply With Quote
Advert
Old 09-01-2016, 11:34 AM   #18
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
yes, but if the screen width is not gt 600 you have to call mc
encol is offline   Reply With Quote
Old 09-01-2016, 12:41 PM   #19
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by nasser View Post
knc1, this is just a modification of baf's original kterm KUAL script.

If the screen width is NOT gt 600, then it uses the default "keyboard.xml" file, along with associated images in the img/ folder.

If the screen width IS gt 600(original logic to detect the then new PW1), then the "keyboard-wide.xml" file, along with the associated images(bigger) in the img-wide/ folder is used. These files are also used for the latest 300 ppi kindles, but we actually need a new "keyboard-extrawide.xml" file!
It got silently fixed.

The if grew an else statement while we where discussing it.

Or PARMS could have been initialized to the < 600 case and then modified if required.
Six of one, half a dozen of the other - author's choice.
knc1 is offline   Reply With Quote
Old 09-01-2016, 01:19 PM   #20
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by encol View Post
Right!
Copy & Paste is the best friend/worst enemy of a programmer
(I copied it from kterm.sh script)

then try this:

Code:
#!/bin/sh

EXPORT LD_LIBRARY_PATH=/mnt/us/local/lib

EXTENSION=/mnt/us/extensions/kterm


WIDTH=`xwininfo -root|grep Width|cut -d ':' -f 2`
# use wider keyboard layout for screen width greater than 600 px
if [ ${WIDTH} -gt 600 ]; then
  PARAM="-l ${EXTENSION}/layouts/keyboard-wide.xml -e /mnt/us/local/mc/bin/mc"
else
  PARAM="-e /mnt/us/local/mc/bin/mc"
fi

${EXTENSION}/bin/kterm ${PARAM}

# when started from launcher kterm doesn't kill keyboard (why?) so:
killall matchbox-keyboard
Tried it. Kterm doesn't start at all. Returns to KUAL.

Quote:
if you launch from kterm:
Code:
/mnt/us/local/mc/bin/mc
mc is loaded?
mc runs ONLY if I type:
Code:
export LD_LIBRARY_PATH
first, followed by:
Code:
/mnt/us/local/mc/bin/mc
Note that typing:

Code:
EXPORT LD_LIBRARY_PATH
produces an error:

Code:
EXPORT: not found
So I changed EXPORT to export in the script too. Still doesn't work.

Next, since I'm doing this on a KT3, I don't need the bigger keyboard images, so I deleted:
/mnt/us/extensions/kterm/layouts/img-wide folder and /mnt/us/extensions/kterm/layouts/keyboard-wide.xml.
And shortened /mnt/us/extensions/kterm/bin/kterm.sh to:
Code:
#!/bin/sh

/mnt/us/extensions/kterm/bin/kterm

# when started from launcher kterm doesn't kill keyboard (why?) so:
killall matchbox-keyboard
Now kterm still works.

Next I shortened /mnt/us/extensions/mc/bin/mc.sh to:
Code:
#!/bin/sh

export LD_LIBRARY_PATH=/mnt/us/local/lib

/mnt/us/extensions/kterm -e /mnt/us/local/mc/bin/mc

# when started from launcher kterm doesn't kill keyboard (why?) so:
killall matchbox-keyboard
Still mc from KUAL menu doesn't work..

Last edited by nasser; 09-01-2016 at 01:33 PM.
nasser is offline   Reply With Quote
Advert
Old 09-01-2016, 01:36 PM   #21
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Does:
"action": "/mnt/us/extensions/kterm", "parms" : "-e /mnt/us/local/mc/bin/mc"
work in the kual menu?

Note: check capitalization and syntax - I typed that from memory.

Note 2: You may have to edit in an rpath for the library so that you don't need to change the LIBRARY_PATH environment variable.
patchelf is the tool for that, it is posted somewhere around here as an attachment, probably in my ARMhf thread.

Last edited by knc1; 09-01-2016 at 01:38 PM.
knc1 is offline   Reply With Quote
Old 09-01-2016, 02:03 PM   #22
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by knc1 View Post
Does:
"action": "/mnt/us/extensions/kterm", "parms" : "-e /mnt/us/local/mc/bin/mc"
work in the kual menu?

Note: check capitalization and syntax - I typed that from memory.

Note 2: You may have to edit in an rpath for the library so that you don't need to change the LIBRARY_PATH environment variable.
patchelf is the tool for that, it is posted somewhere around here as an attachment, probably in my ARMhf thread.
Sorry, knc1..
Some typos in both my and encol's scripts! Those "bin"s were being missed out!
I finally got it to work by(/mnt/us/extensions/mc/bin/mc.sh):
Code:
#!/bin/sh

export LD_LIBRARY_PATH=/mnt/us/local/lib

/mnt/us/extensions/kterm/bin/kterm -e /mnt/us/local/mc/bin/mc

# when started from launcher kterm doesn't kill keyboard (why?) so:
killall matchbox-keyboard
But... the screen is screwed up... See screenshot attached..
Oh Well.. I reached till here at least.. Have to see what to do next..
Attached Thumbnails
Click image for larger version

Name:	wonky_mc.png
Views:	208
Size:	22.0 KB
ID:	151323  
nasser is offline   Reply With Quote
Old 09-01-2016, 02:23 PM   #23
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Ok.. Found a workaround, somewhat..!
  1. Do a double touch to bring up the kterm menu (1st screenshot attached)
  2. Touch the "Font decrease" option (once)
  3. Now the screen gets fixed! (2nd screenshot attached)
Attached Thumbnails
Click image for larger version

Name:	screenshot_2016_09_01T23_41_28+0530.png
Views:	159
Size:	22.8 KB
ID:	151324   Click image for larger version

Name:	screenshot_2016_09_01T23_41_39+0530.png
Views:	148
Size:	20.0 KB
ID:	151325  
nasser is offline   Reply With Quote
Old 09-02-2016, 02:00 AM   #24
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Midnight Commander - KUAL Button plus Start from kterm options

I simplified the steps a little. This way, we have the options of:
  1. Starting mc from KUAL(with the double touch, font decrease menu button select hack to fix the screen)
  2. Starting mc from kterm - type ./mc
  3. Starting mc in editor mode from kterm (file name to be supplied as parameter) - type ./mcedit
  4. Starting mc in viewer mode from kterm (file name to be supplied as parameter) - type ./mcview

Add the following files to /mnt/us/extensions/kterm:

mc:
Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib
/mnt/us/local/mc/bin/mc
mcedit:
Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib
/mnt/us/local/mc/bin/mc -e $@
mcview:
Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib
/mnt/us/local/mc/bin/mc -v $@
Create folder /mnt/us/extensions/mc
Add files to /mnt/us/extensions/mc

config.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<extension>
	<information>
		<name>mc</name>
		<version>4.7.0.10</version>
		<author>various</author>
		<id>mc</id>
	</information>
	<menus>
		<menu type="json" dynamic="true">menu.json</menu>
	</menus>
</extension>
menu.json:
Code:
{
	"items": [
		{"name": "mc", "priority": 1, "action": "/mnt/us/extensions/mc/bin/mc.sh"}
	]
}
Create folder /mnt/us/extensions/mc/bin
Add file to /mnt/us/extensions/mc/bin:

mc.sh:
Code:
#!/bin/sh

/mnt/us/extensions/kterm/bin/kterm -e /mnt/us/extensions/kterm/mc
The screen fix hack for the KUAL button mc is a slight drawback... until somebody can improve on it!
nasser is offline   Reply With Quote
Old 09-02-2016, 02:54 AM   #25
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
Why you don't share the zip?
encol is offline   Reply With Quote
Old 09-02-2016, 03:50 AM   #26
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by encol View Post
Why you don't share the zip?
Done.
Assumptions:
  1. Kterm is already installed in /mnt/us/extensions/kterm (http://www.fabiszewski.net/kindle-terminal/)
  2. Midnight Commander Dump is already installed in /mnt/us/local (the dump is somewhere in mobileread)
Attached Files
File Type: zip mc.zip (1.8 KB, 163 views)
nasser is offline   Reply With Quote
Old 10-01-2016, 02:05 AM   #27
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Screen distortion issue solved!
The new kterm version fixes it. See https://www.mobileread.com/forums/sho...&postcount=208
nasser is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with Android Commander and 2.5.1 Softroot. chas0039 Nook Developer's Corner 10 12-07-2010 08:58 PM
DR800 Midnight Commander dima_tr iRex 8 10-22-2010 11:48 AM
Ghost Commander 1.18 leo315 enTourage eDGe 0 08-28-2010 03:04 AM
Android Ghost Commander 1.18 leo315 enTourage Archive 0 08-28-2010 03:02 AM
Midnight Commander yokos iRex 9 08-10-2008 07:12 AM


All times are GMT -4. The time now is 08:44 AM.


MobileRead.com is a privately owned, operated and funded community.