View Single Post
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#17
OK, here is my working solution now, based on Ade's tip and searching in various places:

Code:
mkdir /home/user/.disable-backlight
/usr/sbin/disable-backlight.sh
Code:
#!/bin/sh
#Saving user's current choice of display blanking mode
gconftool -g /system/osso/dsm/display/inhibit_blank_mode > /home/user/.disable-backlight/dim

#Let's disable screen blanking, so it won't get "dimmed", resulting in backlight getting enabled again...
#Disabling dimming and keeping blanking would be better, but settings allow only the opposite situation :(
gconftool -s --type int /system/osso/dsm/display/inhibit_blank_mode 3

#Disabling ambient light sensor's influence on screen brightness, for a while...
sed -ie 's/brightness-als/brightness-simple/' /etc/mce/mce.ini
stop mce || exit 1
sleep 1
start mce || exit 1
sleep 2

#Saving current backlight value, and disable backlight completely
cat /sys/class/backlight/acx565akm/brightness > /home/user/.disable-backlight/brightness
echo 0 > /sys/class/backlight/acx565akm/brightness

#bye bye
exit 0
/usr/sbin/enable-backlight.sh
Code:
#!/bin/sh
# Setting user's choice for dimming
DIM=$(cat /home/user/.disable-backlight/dim)
gconftool -s --type int /system/osso/dsm/display/inhibit_blank_mode $DIM

#Enabling ambient light sensor's influence on screen brightness, again...
sed -ie 's/brightness-simple/brightness-als/' /etc/mce/mce.ini
stop mce
sleep 1
start mce
sleep 2

#...and enabling initial backlight
BCL=$(cat /home/user/.disable-backlight/brightness)
echo $BCL > /sys/class/backlight/acx565akm/brightness

#bye bye
exit 0
Current limitation - it require setting screen to "never blank" (for example, via simple brightness applet), or, after given timeout, backlight will come back again (faded).

Also, side effect of starting mce is that device asks for lock code. No problem if someone doesn't use one (unwise), or doesn't use ambient light sensor (then it doesn't require restarting mce). Probably, won't be a problem with MCE replacement, after approriate feature request.

Now, I need to find how to disable screen blanking timeout from terminal (just like checkbox in simple brightness applet does).

Cheers,
/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!

Last edited by Estel; 2014-08-27 at 22:47.
 

The Following 4 Users Say Thank You to Estel For This Useful Post: