maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Custom Brightness for N900 - no ALS (https://talk.maemo.org/showthread.php?t=63985)

dr_frost_dk 2010-10-20 17:25

Re: Custom Brightness for N900 - no ALS
 
Quote:

Originally Posted by JonWW (Post 845953)
Try a dbus-monitor command, it will save you battery as you will not be running a point less loop all the time doing something that hardly ever needs to be done.
Code:

#!/bin/sh

dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_ind' | while grep -q "display_status_ind"
do
  echo 160 >/sys/class/backlight/acx565akm/brightness
done

This code will only ever activate when the brightness changes (hopefully), I have not been playing around with /etc/mce/mce.ini so cannot say how well it will work for you.

Can you tell me how to make your nice script run on boot.

dr_frost_dk 2010-10-20 23:14

Re: Custom Brightness for N900 - no ALS
 
as i said i'm not the most hardcore programmer, so if anybody can tell me how to get JonWW's script to start up on boot that would be nice.

dr_frost_dk 2010-10-21 10:45

Re: Custom Brightness for N900 - no ALS
 
been trying various things....
still can't figure out how to make this run on startup.....

Tigerite 2010-10-21 11:04

Re: Custom Brightness for N900 - no ALS
 
You could try with fcron, but tread carefully:

http://wiki.maemo.org/Fcron#Configuration

JonWW 2010-10-21 11:24

Re: Custom Brightness for N900 - no ALS
 
Look in
Code:

/etc/event.d
the start up scripts for many programs are in there, look at them and adapt one to suit your needs.

dr_frost_dk 2010-10-21 12:12

Re: Custom Brightness for N900 - no ALS
 
allmost got it working now just need help with one last thing:
It now starts the scrips on boot (started hildon-desktop) but it does not keep running, and brightness is back to normal after keyock or "fadeout"

my /etc/event.d/frost_custom_settings
--------------------------------------------------
start on started hildon-desktop
stop on starting shutdown

script
echo 4 >/sys/class/i2c-adapter/i2c-2/2-0063/region
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
dbus-monitor --system type='signal',interface='com.nokia.mce.signal',mem ber='display_status_in' | while grep -q "display_status_ind"
do
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
done
end script
-----------------------------------------

what am i doing wrong???

JonWW 2010-10-21 12:30

Re: Custom Brightness for N900 - no ALS
 
Run an boot setup should go here
/etc/event.d/frost_custom_settings:
Code:

start on started hildon-desktop
stop on starting shutdown
exec /etc/init.d/frost_custom_settings

Appartently scripts to then be run should go in /etc/init.d so
/etc/init.d/frost_custom_settings:
Code:

echo 4 >/sys/class/i2c-adapter/i2c-2/2-0063/region
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_in' | while grep -q "display_status_ind"
do
  cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
done


dr_frost_dk 2010-10-21 12:46

Re: Custom Brightness for N900 - no ALS
 
still no cigar.....
it still only runs on startup, but doesn't keep going....


scratch that, there was a typo in the code in my script.....
member='display_status_in' should had been member='display_status_ind'

dr_frost_dk 2010-10-21 12:55

Re: Custom Brightness for N900 - no ALS
 
now i just have to make a widget or something that does

----------------
"get value" from widget (brightness)
echo (brightness) >/sys/class/backlight/acx565akm/brightness
write/echo (brightness) >/home/user/bright_setting

than it should change brightness and use the value from /home/user/bright_setting

the widget can be made with 2 - xx memory settings for the settings you like to use.

MANY thanks to JonWW for all the help in finally making this work.
No more stupid ALS and a custom brightness thats suits the user

I have made a complete guide to this at the first post now.

This so far only gives you 1 brightness setting but a homemade widget can be made to give you more settings.
This does not change the stock 5 settings, witch after the removal of ALS will be 5 very low steps.
If anybody finds out how to change the 5 stock steps to 5 custom steps please post it here or let me know :).

JonWW 2010-10-21 13:14

Re: Custom Brightness for N900 - no ALS
 
Try experimenting with 'Simple Brightness Applet' in your do loop to see what value it set the screen brightness to, then if those value appear when you 'cat /sys/class/backlight/acx565akm/brightness' substitute you own values to suit you.

Run you script in XTerm to see whats going on first.

Keep us updated.


All times are GMT. The time now is 19:26.

vBulletin® Version 3.8.8