|
|
#1 |
|
Enhtusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 2340139
Join Date: Dec 2018
Device: K3 DxG PW1 KV PW4
|
Automatic backlight when waking up
I want to share this small KUAL extension that briefly enables the backlight when the device wakes up.
Code:
SOURCES=$'com.lab126.powerd'
get_light_level () {
head -n1 /sys/class/backlight/bl/actual_brightness
}
lipc-wait-event -m com.lab126.powerd outOfScreenSaver | while read event; do
sleep 0.1
if [ $(get_light_level) -eq 0 ]; then
echo -n "10" > /sys/class/backlight/bl/brightness
sleep 10
if [ $(get_light_level) -eq 10 ]; then
echo -n "0" > /sys/class/backlight/bl/brightness
fi
fi
done
Sometimes when reading in a bright daylight I disable the backlight to preserve some battery juice. But often, when I go to sleep and decide to read some more I then realize that BL is turned off, so I had to grab flashlight/phone/jar of fireflies to just find the controls to turn it on. That is actually pretty annoying so here's a simple solution for that. Solution The script waits for device wake-up event then it checks whether the backlight is off and turns it on for 10s if it is. During that 10s you need to adjust the BL to a desired level, as it'll go off if you don't. Script does nothing if any level of backlight was set before. Notes
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PW4 problem waking up | tomsem | Amazon Kindle | 5 | 03-08-2019 10:26 PM |
| Aura H2O H2O IR sometimes not waking up | eenk | Kobo Reader | 7 | 09-19-2015 03:41 PM |
| Automatic Convert and Automatic Add not working together | kylliancole | Calibre | 3 | 08-04-2012 12:57 AM |
| A Waking of Rooks | delavallad14 | Self-Promotions by Authors and Publishers | 0 | 07-10-2012 04:39 AM |
| Waking up K1 taking longer? | KlondikeGeoff | Amazon Kindle | 10 | 09-17-2009 08:56 AM |