Copying from an old answer of mine to a question: XF86MonBrightnessUp/XF86MonBrightnessDown special keys not working
Edit: As noted below, you must have acpi installed on your machine for these to work :)
Edit 2: This code increments/decrements the brightness values by 1, but some models will have values that range in the thousands, so modify the change accordingly.
This is an old question, but an answer may help out others. I ran into an issue upon a fresh installation of i3wm on my laptop where, for whatever reason, my XF86MonBrightnessUp/Down keys weren't being registered (I checked with xev). What I ended up doing is creating acpi actions and events which corresponded to the keys being pressed.
The following are the actions/events I defined in /etc/acpi/actions and /etc/acpi/events, respectively:
Actions
/etc/acpi/actions/bl-down.sh
#!/bin/sh
bl_device=/sys/class/backlight/acpi_video0/brightness
echo $(($(cat $bl_device)-1)) | sudo tee $bl_device
/etc/acpi/actions/bl-up.sh
#!/bin/sh
bl_device=/sys/class/backlight/acpi_video0/brightness
echo $(($(cat $bl_device)+1)) | sudo tee $bl_device
Events
/etc/acpi/events/bl-down
event=video/brightnessdown BRTDN 00000087 00000000
action=/etc/acpi/actions/bl-down.sh
/etc/acpi/events/bl-up
event=video/brightnessup BRTUP 00000086 00000000
action=/etc/acpi/actions/bl-up.sh
You can verify your brightnessup/down acpi event codes by using acpi_listen in your terminal and then pressing the relevant key combination (e.g., for me, it's Fn + Down Arrow for brightness down).
Finally, don't forget to restart acpid with sudo /etc/init.d/acpid reload
Note: Your backlight device may be defined in a different location than /sys/class/backlight/acpi_video0 - that's just where mine happened to be. Do some poking around.