This worked on my Sony Vaio T13:
- open your terminal (Ctrl+Alt+t)and type
sudo acpi_listen
.
Now this terminal will "listen" to the keyboard.
- Hit the shortcut for brightness down and brightness up, in this case:
Fn+F4 and Fn+F5.
You should see how this is interpreted on terminal. Typically something like:
sony/hotkey SNC 00000001 00000011
sony/hotkey SNC 00000001 00000010
or similar.
- Open another terminal without closing the previous one. And type:
gksu gedit /etc/acpi/events/sony-brightness-up
this will open a text file. Copy and paste in the text file this code:
event=sony/hotkey SNC 00000001 00000011
action=/etc/acpi/brightup.sh
make sure your doing it right (that's why you should have kept the first terminal open): if the output from step 2 was different then you'd have to type
event="whatever-was-in-your-output"
action=/etc/acpi/brightup.sh
save and close the text file.
- In terminal type:
gksu gedit /etc/acpi/events/sony-brightness-down
this opens a different text file. In the text file copy-paste this (again, change the bit "event= ..." if necessary):
event=sony/hotkey SNC 00000001 00000010
action=/etc/acpi/brightdown.sh
save and close.
- In terminal type
gksu gedit /etc/acpi/brightdown.sh
and in the text file that will open type:
#!/bin/bash
curr=cat /sys/class/backlight/intel_backlight/actual_brightness
if [ $curr -gt 406 ]; then
curr=$((curr-406));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi
save and close.
- In terminal type:
gksu gedit /etc/acpi/brightup.sh
and in the document type:
#!/bin/bash
curr=cat /sys/class/backlight/intel_backlight/actual_brightness
if [ $curr -lt 4477 ]; then
curr=$((curr+406));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi
save and close.
To make these scripts executable, type in terminal:
sudo chmod +x /etc/acpi/events/sony-brightness-up
sudo chmod +x /etc/acpi/events/sony-brightness-down
sudo chmod +x /etc/acpi/brightdown.sh
sudo chmod +x /etc/acpi/brightup.sh
- Finally, restart acpid by typing in terminal:
sudo service acpid restart
I still need to do this everytime I boot ...
– Alex Barreira Oct 11 '12 at 19:15