brightness keys adjustment howto
Oguz Yarimtepe
comp.ogz at gmail.com
Fri Jun 20 05:30:50 UTC 2008
Hi all,
I am trying to setup the brightness keys at my a laptop. Although i
made searches and tried different methods i couldn`t make them work. I
am using Ubuntu 8.04.
Here is the output when i press fn+f5 to increase brightness and fn+f4
to decrease it.
#tail -f /var/log/acpid
[Fri Jun 20 07:52:10 2008] received event "video DD03 00000086 00000000"
[Fri Jun 20 07:52:10 2008] notifying client 5539[110:122]
[Fri Jun 20 07:52:10 2008] notifying client 5689[0:0]
[Fri Jun 20 07:52:10 2008] executing action "/etc/acpi/video_brightnessup.sh"
[Fri Jun 20 07:52:10 2008] BEGIN HANDLER MESSAGES
[Fri Jun 20 07:52:10 2008] END HANDLER MESSAGES
[Fri Jun 20 07:52:10 2008] action exited with status 0
[Fri Jun 20 07:52:10 2008] completed event "video DD03 00000086 00000000"
[Fri Jun 20 07:52:13 2008] received event "video DD03 00000087 00000000"
[Fri Jun 20 07:52:13 2008] notifying client 5539[110:122]
[Fri Jun 20 07:52:13 2008] notifying client 5689[0:0]
[Fri Jun 20 07:52:13 2008] executing action "/etc/acpi/video_brightnessdown.sh"
[Fri Jun 20 07:52:13 2008] BEGIN HANDLER MESSAGES
[Fri Jun 20 07:52:13 2008] END HANDLER MESSAGES
[Fri Jun 20 07:52:13 2008] action exited with status 0
[Fri Jun 20 07:52:13 2008] completed event "video DD03 00000087 00000000"
I changed the video_brightness*.sh files as below:
# cat /etc/acpi/video_brightnessdown.sh
#!/bin/sh
value="`cat /proc/acpi/video/VGA0/DD03/brightness | grep current: |
awk '{print $2;}'`"
if [ $value -eq 0 ]
then
value=90
fi
if [ $value -le 30 ]
then
value=30
else
value=`expr $value - 10`
fi
echo $value > /proc/acpi/video/VGA0/DD03/brightness
# cat /etc/acpi/video_brightnessup.sh
#!/bin/sh
value="`cat /proc/acpi/video/VGA0/DD03/brightness | grep current: |
awk '{print $2;}'`"
if [ $value -eq 0 ]
then
value=90
fi
if [ $value -ge 90 ]
then
value=90
else
value=`expr $value + 10`
fi
echo $value > /proc/acpi/video/VGA0/DD03/brightness
# cat /proc/acpi/video/VGA0/DD03/brightness
levels: 100 80 30 40 50 60 70 80 90 100
current: 30
I also dumped the current key mapping as follows:
#xmodmap -pke > xmodmap.conf
#cp xmodmap.conf /etc
I edited the xmodmap.conf file, because i wasn`t seeing any keysym
assignment when i press fn+f4 and fn+f5
Here is the current output of xev for fn+f5 and fn+f4 press
KeyPress event, serial 27, synthetic NO, window 0x3c00001,
root 0x4a, subw 0x0, time 1267359, (526,356), root:(530,405),
state 0x0, keycode 212 (keysym 0x1008ff4e, XF86LaunchE), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 27, synthetic NO, window 0x3c00001,
root 0x4a, subw 0x0, time 1267359, (526,356), root:(530,405),
state 0x0, keycode 212 (keysym 0x1008ff4e, XF86LaunchE), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 30, synthetic NO, window 0x3c00001,
root 0x4a, subw 0x0, time 1269749, (526,356), root:(530,405),
state 0x0, keycode 101 (keysym 0x1008ff4d, XF86LaunchD), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x3c00001,
root 0x4a, subw 0x0, time 1269749, (526,356), root:(530,405),
state 0x0, keycode 101 (keysym 0x1008ff4d, XF86LaunchD), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
I added the XF86LaunchE and XF86LaunchD parts at the xmodmap.conf[1] file.
#cat /etc/gdm/PostLogin/Default
#!/bin/sh
#
# Note: this is a sample and will not be run as is. Change the name of this
# file to <gdmconfdir>/PostLogin/Default for this script to be run. This
# script will be run before any setup is run on behalf of the user and is
# useful if you for example need to do some setup to create a home directory
# for the user or something like that. $HOME, $LOGNAME and such will all be
# set appropriately and this script is run as root.
xmodmap /etc/xmodmap.conf
At the current situation i can see the brightness adjustment screen
that shows the bar of the brightness increase and decrease when i
press the keys. Though there is no increase or decrease at the
brightness.
There is a problem which i realease while pressing the keys:
#tail -f /var/log/messages
Jun 20 08:15:52 vestel-laptop kernel: [ 376.211390] atkbd.c: Unknown
key pressed (translated set 2, code 0xd6 on isa0060/serio0).
Jun 20 08:15:52 vestel-laptop kernel: [ 376.211401] atkbd.c: Use
'setkeycodes e056 <keycode>' to make it known.
Jun 20 08:15:53 vestel-laptop kernel: [ 376.338908] atkbd.c: Unknown
key pressed (translated set 2, code 0xd6 on isa0060/serio0).
Jun 20 08:15:53 vestel-laptop kernel: [ 376.338918] atkbd.c: Use
'setkeycodes e056 <keycode>' to make it known.
Although i am pressing fn+f5 and fn+f4 i still see the same scancode
that should be set for e056.
I checked the keycodes of pressing fn+f5 and fn+f4
#showkey -s
press any key (program terminates after 10s of last keypress)...
0x9c
0xe0 0x54 0xe0 0xd4
0xe0 0x4c 0xe0 0xcc
So my fist question is whether it is normal to see the same scancode
at the dmesg for different keycodes.
Can my problem related with a kernel bug or bios? If not how can i
solve it? If so how can i solve it :)
[1] http://pastebin.com/m52bc6175
[2] dmesg: http://pastebin.com/m2fbface8
Thanx.
--
Oğuz Yarımtepe
More information about the ubuntu-users
mailing list