Managed to resolve issue with sleep on my device, which apparently only supports
"suspend to idle" (or freeze power state) on cherrytrail / baytrail devices.
Essentially
the problem is that the backlight of the screen remains on when the
device is asleep, unless you set the power state to freeze (ie: echo freeze > sys/power/state)
I've
seen people using Tasker to achieve a similar concept of applying this
state when the system becomes idle, but I'd rather not rely on an app to
do this but instead have a script running behind the scenes, so I wrote
one, which you can find online at:
https://gist.github.com/ouija/a1e5389172bd79c75977ae9671b639fc
You
can add this to the init.sh script under the do_bootcomplete()
function, with a case switch defined for your particular device, for
example something similar to this:
case "$(cat $DMIPATH/uevent)" in
*NS-P08W7100*)
# Run sleep freeze state script sh /etc/sleep.sh > /dev/null 2>&1 &
;;
esac
Just copy the sleep.sh script to the /etc directory and update the device identifier to match your own.
This
script basically checks when the device is asleep, and if so, it sets
the power state to freeze. It does this ever 30 seconds, so the device
doesn't immediately go into "freeze" mode when you press the power
button to put it to sleep, which I found more user-friendly in that the
device is a little slower to "wake" from a freeze state then the default
state, so having a 30 second buffer is nice to have, when you accidentally put
the device to sleep or need to quickly wake it after doing so! :)
Wanted to share in case anyone else is looking to achieve something similar and doesn't want to rely on a third-party app to do so. Enjoy!