PDA

View Full Version : Blanking the screen instantly


Mikma
09-13-2008, 03:20 PM
For some time I've been trying to find a way to blank the screen if I click a button from Personal Launcher. Here's the best solution i have found so far.

blank.sh:

#!/bin/sh
gconftool -t int -s /system/osso/dsm/display/display_blank_timeout 1
gconftool -t int -s /system/osso/dsm/display/display_dim_timeout 1
sleep 1
gconftool -t int -s /system/osso/dsm/display/display_blank_timeout 60
gconftool -t int -s /system/osso/dsm/display/display_dim_timeout 30

When executed it will blank the screen after 1sec, then it will set the previous values i have.

Anyone knows a better way?

codeMonkey
09-17-2008, 05:42 AM
Don't know of a better solution, but an improvement would be:

#!/bin/sh
blanktime=`gconftool -g /system/osso/dsm/display/display_blank_timeout`
dimtime=`gconftool -g /system/osso/dsm/display/display_dim_timeout`
gconftool -t int -s /system/osso/dsm/display/display_blank_timeout 1
gconftool -t int -s /system/osso/dsm/display/display_dim_timeout 1
sleep 1
gconftool -t int -s /system/osso/dsm/display/display_blank_timeout $blanktime
gconftool -t int -s /system/osso/dsm/display/display_dim_timeout $dimtime

So that if you ever want to change your default dimming options it won't reset the values back.
And now it is more generic.

fanoush
09-17-2008, 07:26 AM
Anyone knows a better way?
Not sure if it is better but you can run
chroot /mnt/initfs dsmetest -d 2
as root to turn the display off. Try also
chroot /mnt/initfs dsmetest to see other possibilities (-d 0 and 1 may be useful too)

codeMonkey
09-17-2008, 07:36 AM
That's definitely a bit quicker and saves fiddling with dimming values, and very easy to run it as root if you have rootsh installed.