Difference between revisions of "LCD Brightness"

From ThinkWiki
Jump to: navigation, search
Line 1: Line 1:
 
{{Stub}}
 
{{Stub}}
  
== LCD Brightness ==
+
== Regular ACPI ==
  
 
This worked for my {{X61}}:
 
This worked for my {{X61}}:
Line 22: Line 22:
 
  #!/bin/sh
 
  #!/bin/sh
 
  xbacklight -inc 10%
 
  xbacklight -inc 10%
 +
=== 2.6.26 kernel ===
  
 +
If you are using a 2.6.26 kernel, you are supposed to use the regular ACPI backlight control instead of thinkpad-acpi, on any Lenovo (Windows Vista-capable) ThinkPad.
 +
 +
Modify the kernel config by first disabling CONFIG_THINKPAD_ACPI_VIDEO and then enabling both CONFIG_VIDEO_OUTPUT_CONTROL and CONFIG_ACPI_VIDEO [http://www.nabble.com/T61-Brightness-keys-with-2.6.26-not-working-(NVIDIA)-td18577619.html]  While you are at it, be sure to read the well-written help sections for the kernel config settings :)
 +
 +
== Thinkpad-ACPI ==
 +
 +
If you have an older ThinkPad model, such as the {{T20}}, you may want to use [[thinkpad-acpi]].
 +
You can adjust the brightness of your screen by software using either procfs or sysfs.
 +
 +
If the following commands fail, you may want to try other module parameters for thinkpad-acpi. I had to use <tt>backlight_mode=1</tt> for example on my {{T20}}.
 +
Just add the following line to your {{path|/etc/modprobe.conf}}
 +
options thinkpad-acpi brightness_mode=1
 +
 +
See the chapter <tt>LCD brightness control</tt> of {{path|Documentation/laptops/thinkpad-acpi.txt}} in the kernel sources for more informations.
 +
 +
==== Using procfs ====
 +
 +
To adjust the brightness to a certain level:
 +
 +
{{cmdroot|echo 'level 3' > /proc/acpi/ibm/brightness}}
 +
 +
Just one level up or down:
 +
 +
{{cmdroot|echo 'up' > /proc/acpi/ibm/brightness}} <br />
 +
{{cmdroot|echo 'down' > /proc/acpi/ibm/brightness}}
 +
 +
See {{path|/proc/acpi/ibm/brightness}} for a list of all available commands.
 +
 +
==== Using sysfs ====
 +
 +
The sysfs-interface allows more a flexible method of brightness control:
 +
 +
Get the current brightness level:
  
== 2.6.26 kernel ==
+
{{cmdroot|cat /sys/class/backlight/thinkpad_screen/actual_brightness}}
  
If you are using a 2.6.26 kernel, you are supposed to use the regular ACPI backlight control instead of thinkpad-acpi, on any Lenovo (Windows Vista-capable) ThinkPad.
+
Get the highest brightness level:
 +
 
 +
{{cmdroot|cat /sys/class/backlight/thinkpad_screen/max_brightness}}
 +
 
 +
Adjust the brightness to a certain level:
  
Modify the kernel config by first disabling CONFIG_THINKPAD_ACPI_VIDEO and then enabling both CONFIG_VIDEO_OUTPUT_CONTROL and CONFIG_ACPI_VIDEO [http://www.nabble.com/T61-Brightness-keys-with-2.6.26-not-working-(NVIDIA)-td18577619.html]  While you are at it, be sure to read the well-written help sections for the kernel config settings :)
+
{{cmdroot|echo 3 > /sys/class/backlight/thinkpad_screen/brightness}}
  
 
== Ubuntu 8.10 Intrepid Ibex ==
 
== Ubuntu 8.10 Intrepid Ibex ==
 
The hardware keys work out of the box on a clean install of Ubuntu 8.10 Intrepid Ibex.  No tweaking necessary.
 
The hardware keys work out of the box on a clean install of Ubuntu 8.10 Intrepid Ibex.  No tweaking necessary.

Revision as of 14:57, 19 December 2008

This page is a stub

You can help ThinkWiki by expanding it.

Regular ACPI

This worked for my X61:

Once your brightness keys work, you can set the brightness by writing to the procfs:

# echo 100 > /proc/acpi/video/VID1/LCD0/brightness

using a script and acpid events. However this may lead to a bug (screen flickers) described on the Debian mailing list [[1]]. This bug is related to the X server as it does not occur on the tty1. To fix it change your xrandr backlight control to native:

$ $xrandr --output LVDS --set BACKLIGHT_CONTROL native

For my X61, these following scripts from this japanese site helped:

% cat /etc/acpi/video_brightnessdown.sh
#!/bin/sh
xbacklight -dec 10%
% cat /etc/acpi/video_brightnessup.sh
#!/bin/sh
xbacklight -inc 10%

2.6.26 kernel

If you are using a 2.6.26 kernel, you are supposed to use the regular ACPI backlight control instead of thinkpad-acpi, on any Lenovo (Windows Vista-capable) ThinkPad.

Modify the kernel config by first disabling CONFIG_THINKPAD_ACPI_VIDEO and then enabling both CONFIG_VIDEO_OUTPUT_CONTROL and CONFIG_ACPI_VIDEO [2] While you are at it, be sure to read the well-written help sections for the kernel config settings :)

Thinkpad-ACPI

If you have an older ThinkPad model, such as the T20, you may want to use thinkpad-acpi. You can adjust the brightness of your screen by software using either procfs or sysfs.

If the following commands fail, you may want to try other module parameters for thinkpad-acpi. I had to use backlight_mode=1 for example on my T20. Just add the following line to your /etc/modprobe.conf

options thinkpad-acpi brightness_mode=1

See the chapter LCD brightness control of Documentation/laptops/thinkpad-acpi.txt in the kernel sources for more informations.

Using procfs

To adjust the brightness to a certain level:

# echo 'level 3' > /proc/acpi/ibm/brightness

Just one level up or down:

# echo 'up' > /proc/acpi/ibm/brightness
# echo 'down' > /proc/acpi/ibm/brightness

See /proc/acpi/ibm/brightness for a list of all available commands.

Using sysfs

The sysfs-interface allows more a flexible method of brightness control:

Get the current brightness level:

# cat /sys/class/backlight/thinkpad_screen/actual_brightness

Get the highest brightness level:

# cat /sys/class/backlight/thinkpad_screen/max_brightness

Adjust the brightness to a certain level:

# echo 3 > /sys/class/backlight/thinkpad_screen/brightness

Ubuntu 8.10 Intrepid Ibex

The hardware keys work out of the box on a clean install of Ubuntu 8.10 Intrepid Ibex. No tweaking necessary.