Active Topics

 


Reply
Thread Tools
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#1
I have a script that runs
/etc/init.d/mce stop
so I can use more of the hardware keys to do different junk.

After I'm done using this I then
sudo /etc/init.d/mce start

The thing is, my original screen brightness and screen blanking timeout numbers are different afterwards.

I then have to go to the Control panel, Display, then click on Okay for them to restore back to their original settings.

Is there any command that I can add to the script so it will do this for me?

I'm using Advanced-Backlight by the way.

Thanks.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#2
Not sure why your timeout would be different but MCE does set brightness back to its 1-5 value. You can read the value adv-brightness uses from gconf and write it to /sys/devices/platform/omapfb/panel/backlight_level (multiply it by 2 and add 1). Install gconf-editor to find the gconf value, each app has its own folder.

What are you using the hardware keys for? You can get the power button from a HAL dbus signal and the home key can be used by current app if you grab the keyboard with X. The other keys are all sent to current app.
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#3
I'm currently using this script with ADOM.

Since I only have an N800, it just gives me three extra hardware keys that I can bind for the game, but for me, it's worth it.

I also use this with some of the emulators like DrNokSnes.

But yeah, as far as I know, the only way to get control of these three keys (Escape, Menu, and Home buttons) is to stop MCE.

Once MCE starts again, all of the display settings are thrown completely off unless I go to the Control Panel, Display and then click on Okay.

All of my scripts are mostly copies and pastes from other users here with a simple twist.

I can't program a single thing.

I was hoping for something I could add to my script to do this instead of doing the whole App Manager garbage manually.

Hope this makes sense.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#4
Do you know how to create shell scripts and execute them from icons?

This code will open the display control panel. You could put it in a shell script after the MCE start command so the display control panel always opens immediately after restarting MCE.
Code:
run-standalone.sh dbus-send --system --type=method_call -dest=com.nokia.controlpanel /com/nokia/controlpanel/rpc com.nokia.controlpanel.run_applet string:libcpdisplay.so boolean:true
Or you could put the following code after the MCE start command and it should read the current values from gconf and write them back to gconf maybe causing MCE to see the correct values.
Code:
restore_value()
{
  gconftool-2 --type $1 --set $2 `gconftool-2 --get $2`
}
restore_value int /system/osso/dsm/display/display_blank_timeout
restore_value int /system/osso/dsm/display/display_dim_timeout
restore_value bool /system/osso/dsm/locks/touchscreen_keypad_autolock_enabled
restore_value bool /system/osso/dsm/display/display_on_with_charger
And this code should update the brightness but you will need to use gconf-editor to find the key used by adv-brightness to store the value and replace XXX.
Code:
value=`gconftool-2 --get XXX`
echo `expr $value \* 2 + 1` > /sys/devices/platform/omapfb/panel/backlight_level
 

The Following 2 Users Say Thank You to auouymous For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#5
This guy talks about steeing screen dim/timeouts form the cli.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following User Says Thank You to vi_ For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#6
Thank you!

I'll give this a try later tonight I hope.

Before, at the end of my script, I had this...
/usr/bin/controlpanel

And then just redid the settings manually.

I like your ideas so much better.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#7
run-standalone.sh dbus-send --system --type=method_call -dest=com.nokia.controlpanel /com/nokia/controlpanel/rpc com.nokia.controlpanel.run_applet string:libcpdisplay.so boolean:true

Usage: dbus-send [--help] [--system | --session] [--dest=NAME] [--type=TYPE] [--print-reply=(literal)] [--reply-timeout=MSEC] <destination object path> <message name> [contents ...]
[1|user@Nokia-N800-43-7|~]
This wouldn't open the Control Panel.


restore_value()
{
gconftool-2 --type $1 --set $2 `gconftool-2 --get $2`
}
restore_value int /system/osso/dsm/display/display_blank_timeout
restore_value int /system/osso/dsm/display/display_dim_timeout
restore_value bool /system/osso/dsm/locks/touchscreen_keypad_autolock_enabled
restore_value bool /system/osso/dsm/display/display_on_with_charger
This doesn't work either.

I have
Brightness period: 30 secs.
Switch off display: 30 secs.

However, once MCE starts again, even with your script, it dims at 90 secs. then blanks at 2 minutes.

I believe it also reloads the brightness value from the control panel and not Advanced Backlight.

value=`gconftool-2 --get XXX`
echo `expr $value \* 2 + 1` > /sys/devices/platform/omapfb/panel/backlight_level
I'm not sure how to get the value of XXX using g-conf.

Please don't give up on me with this.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#8
Originally Posted by Addison View Post
This doesn't work either.

I'm not sure how to get the value of XXX using g-conf.
Does it produce an error?

You need to install the "gconf-editor" package, run it, open the apps folder and find adv-backlight's folder. Inside this folder there will be a key that sounds like it holds the brightness level. Replace XXX with the full path (folders and key name) to that key.
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#9
Does it produce an error?
Nope, no error at all.

Do you have Advanced Backlight?

I thought that came with the SSU because it best supports the whole screen rotation thing?

And I'll try your gconf-editor suggestion right now.

Thanks!
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#10
Okay. It looks like I can't see the entire address because it's grayed out.

 
Reply


 
Forum Jump


All times are GMT. The time now is 12:23.