Is it a problem of key mapping or a problem of acpi support ?
Check in /proc/acpi/
if you have some entries like this one : /proc/acpi/video/GFX0/LCDD/brightness
If you find it, try to set a value maybe like this :
echo "4" > /proc/acpi/video/GFX0/LCDD/brightness
You might want to give this a try:
$ sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
Change the value between 0-15 I believe to make it brighter or dimmer.
You might need to change these as well:
$ sudo echo 950 > /sys/class/backlight/intel_backlight/brightness
$ sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
$ sudo echo 5 > /sys/class/backlight/acpi_video1/brightness
Changing brightness as a regular user
@JosephR. asked this folow-up in the comments and I thought it important enough to incorporate into my answer. If you want to expose this capbility to change brightness from the command line to regular users (the above echo ... > /sys/...
is only accessible to root).
There is a package you can install called xbacklight
which will allow user's to also change the brightness from the command line.
The package is available on Fedora and Ubuntu via repositories so just do either of these commands to install it:
# Ubuntu/Debian
$ sudo apt-get install xbacklight
# Fedora/CentOS
$ sudo yum install xbacklight
To use it:
# backlight 50%
$ xbacklight -set 50
# backlight 100%
$ xbacklight -set 100
xbacklight usage
$ xbacklight --help
usage: xbacklight [options]
where options are:
-display <display> or -d <display>
-help
-set <percentage> or = <percentage>
-inc <percentage> or + <percentage>
-dec <percentage> or - <percentage>
-get
-time <fade time in milliseconds>
-steps <number of steps in fade>
How does user get elevated privileges to do this?
Again more follow-up to @JosephR. asking about this in a comment. It may seem like you as the user have elevated privileges to change the /sys/class/backlight/...
when you use your laptops function keys (on my Thinkpad I use Fn+Home and Fn+End to change brightness). But you aren't really ever directly interacting with the /sys/class/backlight/...
in the way that you think.
You're manipulating it indirectly through D-Bus. D-Bus is allowing you to manipulate this structure, org.freedesktop.Hal.Device.KeyboardBacklight
, and HAL is allowing the privilege to do so. You can see this on my Fedora 14 system like this:
$ grep -i backlight /etc/dbus-1/system.d/*
/etc/dbus-1/system.d/hal.conf: send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
/etc/dbus-1/system.d/hal.conf: send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
In the file hal.conf
:
<!-- Only allow users at the local console to manipulate devices -->
<policy at_console="true">
...
<allow send_destination="org.freedesktop.Hal"
send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
You can even mess with it from the command line via D-Bus like this. You can query the current value:
$ dbus-send \
--print-reply \
--system \
--dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer_backlight \
org.freedesktop.Hal.Device.LaptopPanel.GetBrightness | \
tail -1 | \
awk '{print $2}'
Which returns the value:
15
Even cooler, you can mess with it like this (the bit int32:10
below is setting brightness to "10"):
$ dbus-send \
--print-reply \
--system \
--dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer_backlight \
org.freedesktop.Hal.Device.LaptopPanel.SetBrightness \
int32:10 #2&>1 > /dev/null
You can see that we changed the brightness:
$ cat /sys/class/backlight/acpi_video0/brightness
10
References
Best Answer
You can try
xrandr
tool.First run
xrandr --verbose
and look for a line with resolution likeLVDS1 connected 1024x600+0+0
. The name of your display (LVDS1
in this example) is needed here. Now you are ready to set brightness:xrandr
sets software, not hardware brightness so you can exceed both upper and lower limits: