Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 min LCD bright at boot & keep current at X start?[Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3638

PostPosted: Wed Jan 05, 2011 10:55 am    Post subject: 2 min LCD bright at boot & keep current at X start?[Solv Reply with quote

Hi dear all,
My laptop (Acer TimeLine) has lcd backlight set to max at boot time.
I would like boot procedure to set it to default.

Up to now I have only found one app that can operate, but only under X: xbacklight. Any idea or trail I should follow to have similar behaviour in console?

Laptop has 2 CG, one Intel and one ATI. xbacklight only operates when CG driver is "native":ie doesn't work with radeon xfree driver:
In this last case, depending on the environment (KMS or not) it will either refuse command or accept it without any change.

This is the reason why I feel my problem may be not that easy to solve :?

Thanks for your attention.


Last edited by CaptainBlood on Wed Jan 05, 2011 3:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3638

PostPosted: Wed Jan 05, 2011 1:12 pm    Post subject: Reply with quote

Kind of reply to myself:

Current kernel config provides access to a file to which an echo of a value from 0 to 9 (in my case) allows to change backlight level. Ie :
Code:
echo "0" > /sys/devices/virtual/backlight/acpi_video0/brightness.

which I have set iin /etc/conf.d/local file.

The remaining issue is that backlight level is reset to max when starting X.

I'm still searching for a way to initialisate it to the current backlight level at X launch.

/sys/devices/virtual/backlight/acpi_video provides other files that contains current backlight level and could be copied at X start.
/sys/devices/virtual/backlight/acpi_video\brightness could be allowed to be written by anybody at boot rtime, ie in /etc/conf.d/local as above.
The only problem is how to lauch the echo commmand at X start or more precisely at the end of X start. ( LXDE in my case, I'm about to investigate its autostart file though).

Thanks for your attention.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3638

PostPosted: Wed Jan 05, 2011 3:03 pm    Post subject: Reply with quote

finally made it with:
Code:
        if [ -f sys/devices/virtual/backlight/acpi_video0/brightness ];
            then
            chmod o+w sys/devices/virtual/backlight/acpi_video0/brightness;
            echo "0">/sys/devices/virtual/backlight/acpi_video0/brightness;
        fi;
in /etc/conf.d/local,
Code:
        if [ ! -f sys/devices/virtual/backlight/acpi_video0/brightness ];
            then
            chmod o+w sys/devices/virtual/backlight/acpi_video0/brightness;
            echo "0">/sys/devices/virtual/backlight/acpi_video0/brightness;
        fi;
in ~/.xinitrc. and
Code:
@bash -c "if [ -f ~/.actual_brightness ] && [ -f /sys/devices/virtual/backlight/acpi_video0/brightness ]; then cat ~/.actual_brightness>/sys/devices/virtual/backlight/acpi_video0/brightness; fi"
in /etc/xdg/lxsession/LXDE/autostart.

Plz notice last step is LXDE specfic about its location. I'm sure many other WM have their own way to embed the command.
The last not yet implemented detail would be to avoid the forcing of rhe X brightness when it is intitially set to the max ( as in file /sys/devices/virtual/backlight/acpi_video0/max_brightness)

Syntax may be simplified; sorry I'm not a bash shell expert, but the general idea is there. (and functional too :) )

Thanks for your attention and interest.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum