View previous topic :: View next topic |
Author |
Message |
Spiritmage n00b
Joined: 06 Mar 2005 Posts: 65 Location: Colorado
|
Posted: Tue Jun 03, 2008 7:11 am Post subject: ACPI Brightness |
|
|
Hi all, I have a Thinkpad T61 and currently use xbacklight to control screen brightness. I have followed the power management guide on the gentoo site, but was wondering if anyone could tell me how I should do this:
I want to run:
xbacklight -set 50
when on battery
and
xbacklight -set 100
when using my power supply.
I currently have the battery and default states working. I simply need to know how to make them execute these two commands when it receives the plugged in or unplugged events. Thanks for the help!
Last edited by Spiritmage on Tue Jun 03, 2008 3:42 pm; edited 2 times in total |
|
Back to top |
|
|
pdw_hu Apprentice
Joined: 02 Jun 2008 Posts: 200 Location: Budapest, Hungary
|
Posted: Tue Jun 03, 2008 10:45 am Post subject: |
|
|
Well I use laptop-mode which supports what you need, but in theory (and following the pwrmgmt guide) you could just add
Code: | /usr/bin/xbacklight -set batteryvalue | to /etc/runlevels/battery and the acvalue to /etc/runlevels/default (which is the AC runlevel also).
A problem with xbacklight is that it only works in X (duh! :D), so if you want this to work in the console too you should use
Code: | echo value > /proc/acpi/video/VGA/LCD/brightness | instead of xbacklight
Note: your /proc path may vary |
|
Back to top |
|
|
Spiritmage n00b
Joined: 06 Mar 2005 Posts: 65 Location: Colorado
|
Posted: Tue Jun 03, 2008 3:17 pm Post subject: |
|
|
Thanks for the help.
On the note of controlling with /proc/acpi, I am using xbacklight only because I couldn't find the brightness. I set up thinkpad_acpi and can view other things such as the temperatures around my laptop, but there is no option for brightness. This is odd since that is how I controlled it on my old thinkpad. |
|
Back to top |
|
|
Spiritmage n00b
Joined: 06 Mar 2005 Posts: 65 Location: Colorado
|
Posted: Tue Jun 03, 2008 3:52 pm Post subject: |
|
|
I still can't get it to work. I made a script:
/etc/init.d/lcd-brightness
Code: |
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
set_brightness() {
if on_ac_power
then
ewarn "Setting Brightness -- Full"
/usr/bin/xbacklight -set 100
else
ewarn "Setting Brightness -- Half"
/usr/bin/xbacklight -set 50
fi
}
start() {
set_brightness
}
stop() {
set_brightness
} |
then I did
rc-update add lcd-brightness battery
rc
I know the switching between battery and default runlevels works, but my script doesn't do anything. (I made sure it was executable) |
|
Back to top |
|
|
|