View Single Post
Old 08-27-2017, 01:05 AM   #43
coplate
Guru
coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.
 
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
Ok, so it you want to run these from the command line, this is the syntax:
Code:
lipc-set-prop com.lab126.system executeDebugCommand ';kt'
I just ran it with the same flash.sh you posted, and got the same-ish error
Code:
From messages file:

170826:214338 lipc-set-prop[5961]: E def:fail:source=com.lab126.system, prop=executeDebugCommand:Failed to set property

From command line:
com.lab126.system failed to set value for property executeDebugCommand (0x2 lipcErrInternal)

I noticed you were calling kterm directly, instead of calling kterm.sh, so I tried that, but got the same problem.

I went into kterm.sh and removed the actual call to kterm, and that worked.


I have found that the call to actual kterm exits in failure code 1. and that the debug handler propagates that error.

If you put an echo statement after the call to kterm, then the debug handler will not thrown an error.

I have got the erro message that is actualliy killing kterm.
this flash.sh
Code:
#!/bin/bash
set +e


EXTENSION=/mnt/us/extensions/kterm
DPI=`cat /var/log/Xorg.0.log | grep DPI | sed -n 's/.*(\([0-9]\+\), [0-9]\+).*/\1/p'`
#use different layouts for high resolution devices
if [ ${DPI} -gt 290 ]; then
  PARAM="-l ${EXTENSION}/layouts/keyboard-300dpi.xml"
elif [ ${DPI} -gt 200 ]; then
  PARAM="-l ${EXTENSION}/layouts/keyboard-200dpi.xml"
fi

echo 111111111111111111111111111111111 > /dev/kmsg
${EXTENSION}/bin/kterm -d ${PARAM} "$@" /dev/kmsg 2> /dev/kmsg
echo kterm exited with status code $? > /dev/kmsg 2> /dev/kmsg
echo 2222222222222222222222222222222 > /dev/kmsg
Gives this response
Code:
170826:220909 SCRIPTEXECUTOR[7972]: I script-Executor:main:Ready for execution:Command=/var/local/flash.sh
170826:220909 [ 2016.031417] 111111111111111111111111111111111
170826:220909 [ 2016.072584]
170826:220909 [ 2016.072590] (kterm:7979): Gtk-WARNING **: cannot open display:
170826:220909 [ 2016.075732] kterm exited with status code 1
170826:220909 [ 2016.075995] 2222222222222222222222222222222
I'm not sure why it cannot find the display, when it does work on command line. I have tried copying my ssh env variables over to the script, but no luck. I am never comfortable EXPORTing the envirionmtne variables in a case like this, so you have to put it on the front of the function call.

And here it is, this script works for flash.sh. You can call this /var/local/kterm_launch.sh or whatever you like, no need to change the kterm.sh in the externsions directory.:

Code:
#!/bin/bash

eips 0 0 kterm
DISPLAY=':0.0' /mnt/us/extensions/kterm/bin/kterm.sh &

I banged that in place, and everything seems to be working just fine.

Last edited by coplate; 08-27-2017 at 01:17 AM.
coplate is offline   Reply With Quote