maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   MCE stop and start (https://talk.maemo.org/showthread.php?t=72220)

auouymous 2011-04-24 06:21

Re: MCE stop and start
 
Quote:

Originally Posted by Addison (Post 994000)
Do you have Advanced Backlight?

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

No it doesn't come with SSU. I had adv-backlight installed until I wrote advanced-systemui which replaces all the features in adv-backlight. Couple weeks ago I was forced to format and now have a clean gconf database so I wasn't able to lookup the key for you but knew it was there.

Quote:

Originally Posted by Addison (Post 994002)
It looks like I can't see the entire address because it's grayed out.

The full key name is in the right pane above the dialog.

Replace XXX with /apps/adv-backlight/brightness

Addison 2011-04-24 07:07

Re: MCE stop and start
 
Quote:

Replace XXX with /apps/adv-backlight/brightness
Hey!

Yeah, that actually works!

Only for one second though and then it immediately reverts back to the Control Panel -> Display -> Brightness setting it seems like.

I've tried it 5 times now.

Poops. :(

Okay. If you were to run this from Xterm:
/etc/init.d/mce stop
sudo /etc/init.d/mce start

I just would like the Brightness, Brightness period and Switch off display numbers to be the exact same and functioning as they were before entering those two command lines.

I hope that makes sense and thank you so much for sticking with me on this.

You rock dude! :)

Addison 2011-04-24 07:23

Re: MCE stop and start
 
Eep! :D

I added this at the end of my script:
gconftool-2 -s "/system/osso/dsm/display/display_dim_timeout" 30 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_blank_timeout" 30 -t INT

Now after I've restarted MCE again, the dim and blank times remain the same like they were before (30 seconds each). :)

Is there a way to catch what these two values are at the beginning of the script and then enter them back in afterward?

Like using variables or whatever?

All that's left is to get a better handle on the brightness setting, which goes weird after MCE restart, and then I'm gold. :)

auouymous 2011-04-24 15:17

Re: MCE stop and start
 
Quote:

Originally Posted by Addison (Post 994422)
Eep! :D

I added this at the end of my script:
gconftool-2 -s "/system/osso/dsm/display/display_dim_timeout" 30 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_blank_timeout" 30 -t INT

Now after I've restarted MCE again, the dim and blank times remain the same like they were before (30 seconds each). :)

Is there a way to catch what these two values are at the beginning of the script and then enter them back in afterward?

Like using variables or whatever?

All that's left is to get a better handle on the brightness setting, which goes weird after MCE restart, and then I'm gold. :)


The restore_value code should have worked, try changing the function to:

Code:

restore_value()
{
  value=`gconftool-2 --get "$2"`
  gconftool-2 --type $1 --set "$2" $value
}

And then put the lines that call it after.

Oops! I forgot about DSME when setting the brightness, you can change the value with that file but DSME restores it. The /etc/mce.conf file has a line that loads a filter-brightness-als module, should only work on n810 but maybe if you remove it by commenting out the line and making a copy without that module it might stop reseting brightness. I'll try to write some real code to set DSME brightness when I wake up, poke me if I forget. :)

Addison 2011-05-13 14:56

Re: MCE stop and start
 
Okay, here's the poke you wanted. *lol*

Is there just a simple way to read all of these values before the script and then return them back afterward?


gconftool-2 --type int --set /apps/osso/applet/osso-applet-display/turn_off_display ?
gconftool-2 --type int --set /apps/osso/applet/osso-applet-display/brightness_period ?
gconftool-2 --type int --set /system/osso/dsm/display/display_dim_timeout ?
gconftool-2 --type int --set /system/osso/dsm/display/display_blank_timeout ?

auouymous 2011-05-13 22:20

Re: MCE stop and start
 
Quote:

Originally Posted by Addison (Post 1005565)
Is there just a simple way to read all of these values before the script and then return them back afterward?
gconftool-2 --type int --set /apps/osso/applet/osso-applet-display/turn_off_display ?
gconftool-2 --type int --set /apps/osso/applet/osso-applet-display/brightness_period ?
gconftool-2 --type int --set /system/osso/dsm/display/display_dim_timeout ?
gconftool-2 --type int --set /system/osso/dsm/display/display_blank_timeout ?

I thought the values were correct and just need to be OK'd to restore them? You should have to read and write them to get MCE's attention.

I put together a small program to set the backlight, download it here http://asui.garage.maemo.org/download.html . You don't need to download the source file.

Code:

# advanced backlight
set-brightness `gconftool-2 --get /apps/adv-backlight/brightness`

# ASUI
set-brightness `gconftool-2 --get /apps/asui_state/brightness_level`

Second command is for anyone wanting to do this with ASUI.

Addison 2011-05-21 16:15

Re: MCE stop and start
 
I'm so bad at coding that I'm going to be shameless and ask if you could edit my current script that I'm using with your new backlight app thingy. :)



#! /bin/sh

gconftool-2 --set -t bool /system/osso/af/keyboard-attached true
/etc/init.d/mce stop
killall xbindkeys
xbindkeys -f /home/user/.xbindkeysrc_adom
xmodmap ~/.Xmodmap_adom
xkbd -geometry +65536+65992 -k /media/mmc2/N800/Keyboards/Flat2.xkbd & xkbd -geometry +725+360 -k /media/mmc2/N800/Keyboards/Keypad.xkbd & ssh -l james ancardius.ath.cx
gconftool-2 --set -t bool /system/osso/af/keyboard-attached false
killall xbindkeys
killall xkbd
setxkbmap
sudo /etc/init.d/mce start
gconftool-2 -s "/system/osso/dsm/display/display_brightness_level_step" 1 -t INT
gconftool-2 -s "/system/osso/dsm/display/max_display_brightness_levels" 127 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_brightness" 16 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_dim_timeout" 30 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_blank_timeout" 30 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_brightness_level_step" 1 -t INT
gconftool-2 -s "/system/osso/dsm/display/max_display_brightness_levels" 5 -t INT
xbindkeys
killall roxterm

auouymous 2011-05-21 23:18

Re: MCE stop and start
 
Code:

/FULL/PATH/set-brightness `gconftool-2 --get /apps/adv-backlight/brightness`
Just add that to the bottom and change /FULL/PATH/ to the directory path where you placed the set-brightness binary, /root/bin/ is a good location. And chmod 755 set-brightness so you can execute it.

Addison 2011-05-31 21:48

Re: MCE stop and start
 
Awesome!

That works!

Eeeeeeeee! :D

The correct argument though is
/usr/bin/set-backlight `gconftool-2 --get /apps/adv-backlight/brightness`

I'm still unsure how to use these with variables.

gconftool-2 -s "/system/osso/dsm/display/display_brightness_level_step" 1 -t INT
gconftool-2 -s "/system/osso/dsm/display/max_display_brightness_levels" 127 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_brightness" 16 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_dim_timeout" 30 -t INT
gconftool-2 -s "/system/osso/dsm/display/display_blank_timeout" 30 -t INT

I'd like to use variables to restore the settings back to how they were rather than force something that's always static like how I'm currently doing this.

Thanks chief! :)

JonWW 2011-05-31 22:08

Re: MCE stop and start
 
On the N900 this resets the back light to what ever level it was set to after MCE restarts:
Code:

sleep2
gconftool -s /system/osso/dsm/display/display_brightness \
 `gconftool -g /system/osso/dsm/display/display_brightness` -t int

I have never noticed if the timeout get changed, but in theory the same thing could be done with it


All times are GMT. The time now is 20:13.

vBulletin® Version 3.8.8