Some more Kindle startup scrip tweaks.

First: sleep less. Looks okay on the slowest device I could find
(an indexing Touch in a hottish weather). Tweak if things are still racy
somewhere.

Second: Switch to a gentler approach to get rid of the title bar.
Seems to do the trick, and we don't get a slew of warnings in the logs
on exit ;).
pull/700/head
NiLuJe 10 years ago
parent 854b941dcc
commit 00100ba366

@ -39,7 +39,7 @@ if [ "$(nice)" == "5" ] ; then
# Yield a bit to let stuff stop properly... # Yield a bit to let stuff stop properly...
logmsg "Hush now . . ." logmsg "Hush now . . ."
# NOTE: This may or may not be terribly useful... # NOTE: This may or may not be terribly useful...
sleep 1 usleep 250000
# Kindlet threads spawn with a nice value of 5, we aim for the same -2 as the KF8 reader # Kindlet threads spawn with a nice value of 5, we aim for the same -2 as the KF8 reader
logmsg "Be nice!" logmsg "Be nice!"
@ -102,8 +102,8 @@ if [ "${STOP_FRAMEWORK}" == "yes" ] ; then
# The framework job sends a SIGTERM on stop, trap it so we don't get killed if we were launched by KUAL # The framework job sends a SIGTERM on stop, trap it so we don't get killed if we were launched by KUAL
trap "" SIGTERM trap "" SIGTERM
stop lab126_gui stop lab126_gui
# Let things lie a bit so that we don't hit the black screen of no X ;). # NOTE: Let the framework teardown finish, so we don't start before the black screen...
sleep 2 usleep 1250000
# And remove the trap like a ninja now! # And remove the trap like a ninja now!
trap - SIGTERM trap - SIGTERM
fi fi
@ -114,11 +114,14 @@ fi
if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
count=$(lipc-get-prop -eiq com.github.koreader.kpvbooklet.timer count) count=$(lipc-get-prop -eiq com.github.koreader.kpvbooklet.timer count)
if [ "$count" == "" -o "$count" == "0" ] ; then if [ "$count" == "" -o "$count" == "0" ] ; then
logmsg "Disabling pillow . . ." #logmsg "Disabling pillow . . ."
lipc-set-prop com.lab126.pillow disableEnablePillow disable #lipc-set-prop com.lab126.pillow disableEnablePillow disable
logmsg "Hiding the status bar . . ."
# NOTE: One more great find from eureka (http://www.mobileread.com/forums/showpost.php?p=2454141&postcount=34)
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.hideMe();"}'
PILLOW_DISABLED="yes" PILLOW_DISABLED="yes"
# NOTE: This may or may not be terribly useful... # NOTE: Leave the framework time to refresh the screen, so we don't start before it has finished redrawing after collapsing pillow/the chrome bar
sleep 1 usleep 250000
fi fi
fi fi
@ -176,8 +179,12 @@ fi
if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
# Only if we actually killed it... # Only if we actually killed it...
if [ "${PILLOW_DISABLED}" == "yes" ] ; then if [ "${PILLOW_DISABLED}" == "yes" ] ; then
logmsg "Enabling pillow . . ." #logmsg "Enabling pillow . . ."
lipc-set-prop com.lab126.pillow disableEnablePillow enable #lipc-set-prop com.lab126.pillow disableEnablePillow enable
logmsg "Restoring the status bar . . ."
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.showMe();"}'
# Poke the search bar too, so that we get a proper refresh ;)
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "search_bar", "function": "nativeBridge.hideMe(); nativeBridge.showMe();"}'
fi fi
fi fi

Loading…
Cancel
Save