View Single Post
Old 01-03-2018, 03:58 PM   #52
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by baskerville View Post
@tshering: Is the script packaged in plato-launcher-ksm-0.3.1.zip ok?
I was thinking of something like:
Spoiler:
Code:
#! /bin/sh

WORKDIR=$(dirname "$0")
cd "$WORKDIR" || exit 1

if pidof nickel; then
  FROMNICKEL=true
  eval "$(xargs -n 1 -0 < /proc/$(pidof nickel)/environ | sed -e 's/^/export /')"
  sync
  killall nickel hindenburg sickel fickel fmon > /dev/null 2>&1
else
  FROMNICKEL=false
fi

export LD_LIBRARY_PATH="libs:${LD_LIBRARY_PATH}"

./plato > info.log 2>&1 || mv info.log crash.log

if [ "${FROMNICKEL}" == "true" ]; then
  ./nickel.sh &
fi
so that you have to distribute only one version. KSM would call it with a wrapper script like this
Spoiler:
Code:
#! /bin/sh

# todo: set rotation value for the different device models
# currently I know only for sure that trilogy|kraken|alyssum|daylight need 3
case $PRODUCT in
  trilogy|kraken|alyssum|daylight ) platoRotation="3";;
  * ) platoRotation="3";;
esac

currentRotation=$(cat /sys/class/graphics/fb0/rotate)
echo "${platoRotation}" > /sys/class/graphics/fb0/rotate
cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate


# todo: maybe warn when wifi is on?

${platobasedir}/plato.sh
# alternatively
#cd "${platobasedir}" || exit 1
#export LD_LIBRARY_PATH="libs:${LD_LIBRARY_PATH}"
#./plato > info.log 2>&1 || mv info.log crash.log


echo "${currentRotation}" > /sys/class/graphics/fb0/rotate
cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate

# todo: maybe warn when wifi is on?
note: the line
Code:
cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate
is needed for some models (Aura HD, H2O, H2O2, if I remember correctly).

Are you certain that 3 is the correct rotate value for all models?
tshering is offline   Reply With Quote