Okay, so I kinda solved my problem copying the cr3.sh and start_vlasovlauncher.sh scripts from KSM into my .kobo folder with some modifications, and making a fmon launcher to cr3.sh. This is the code I have used for each of them:
cr3.sh:
Quote:
#!/bin/sh
# we could pass these value as cml parameters, but maybe for now this would be overkill
vlautorun=CoolReader
applicationname=cr3
ksmroot=/mnt/onboard/.kobo
vllauncherini=/mnt/onboard/.kobo/vlasovsoft/launcher.ini
changed=false
oldautorun=
export startedAsAutorun=true;
# modify application script if necessary
if [ $(grep -c 'startedAsAutorun' "/mnt/onboard/.kobo/vlasovsoft/${applicationname}.sh") -lt 1 ]; then
cat <<EOF > "/mnt/onboard/.kobo/vlasovsoft/${applicationname}.sh"
#!/bin/sh
if [ "x\$startedAsAutorun" != "x" ]; then
$applicationname/$applicationname -stylesheet \$STYLESHEET
echo "exit" > \$VLASOVSOFT_FIFO1
else
exec $applicationname/$applicationname -stylesheet \$STYLESHEET
fi
EOF
fi
# modify ini file if necessary
if [ $(grep -c '^autorun=${vlautorun}$' "$vllauncherini") -lt 1 ]; then
changed=true
oldautorun=$(grep "^autorun=" "$vllauncherini")
case ${oldautorun} in
autorun=*)
sed -i "s/$oldautorun/autorun=$vlautorun/" "$vllauncherini"
;;
*)
echo "autorun=$vlautorun" >> "$vllauncherini"
;;
esac
fi
# run launcher
$ksmroot/start_vlasovlauncher.sh
# restore autorun value
if [ "$changed" == "true" ]; then
sed -i "s/autorun=$vlautorun/$oldautorun/" "$vllauncherini"
fi
|
start_vlasovlauncher.sh:
Quote:
#!/bin/sh
ksmroot=/mnt/onboard/.kobo
case $PRODUCT in
dragon|dahlia|snow ) vlasovsoftrotate="2";;
* ) vlasovsoftrotate="0";;
esac
if [ "${vlasovsoftrotate}" != "$(cat /sys/class/graphics/fb0/rotate)" ]; then
echo "${vlasovsoftrotate}" > /sys/class/graphics/fb0/rotate
if [ "${vlasovsoftrotate}" != "$(cat /sys/class/graphics/fb0/rotate)" ]; then
echo "$((vlasovsoftrotate ^ 2))" > /sys/class/graphics/fb0/rotate
fi
fi
frontlightprg=$ksmroot/tools/frontlight
dontTamperwithFrontlight=${dontTamperwithFrontligh t:-"true"}
# frontligth off
[ "$dontTamperwithFrontlight" == "true" ] && [ "$PRODUCT" != "trilogy" ] && [ "$PRODUCT" != "pixie" ] &&
(
$frontlightprg "0"
[ "$KSMdebugmode" == "true" ] && echo "on start: frontlight level set to 0" >> $debug_logfile
)
# set variables
export ROOT="/mnt/onboard/.kobo/vlasovsoft"
VLASOVSOFT_KSM=1
. /mnt/onboard/.kobo/vlasovsoft/launcher.sh
#set frontlight for KSM
[ $PRODUCT != trilogy ] && [ $PRODUCT != pixie ] && [ $PRODUCT != pika ] && (
$frontlightprg "$KSMfrontlightlevel"
[ "$KSMdebugmode" == "true" ] && echo "before exit: frontlight level set to $KSMfrontlightlevel" >> $debug_logfile
)
|
And it actually -kind of- works. A tap on the CoolReader tile makes coolreader start, BUT, when I hit "close" inside CoolReader, the reader, instead of returning to nickel, freezes, and I have to restart it.
Any ideas?