View Single Post
Old 01-10-2018, 12:33 PM   #59
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by tshering View Post
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).
I prefer to have one script and some support files (fmon requires icons/plato.png but KSM doesn't) for each launcher.

Quote:
Originally Posted by tshering View Post
Are you certain that 3 is the correct rotate value for all models?
I'm not.
baskerville is offline   Reply With Quote