This script works for me for doing exactly this. The drawback is that it will continue to set the brightness level even after increasing it manually, when the battery is low, and it does not check if the ac adaptor has been connected.
/etc/acpi/events/battery_changed
event=battery.*
action=/etc/acpi/actions/dim_screen_on_low_battery.sh
/etc/acpi/actions/dim_screen_on_low_battery.sh
#!/bin/bash
BATTERY_LOC="/sys/class/power_supply/BAT0/"
VIDEO_LOC="/sys/class/backlight/acpi_video0/"
percent_left=$((100 * `cat /sys/class/power_supply/BAT0/charge_now` / `
cat /sys/class/power_supply/BAT0/charge_full`))
#echo "$percent_left% battery remaining"
if [ $percent_left -lt 20 ] # Adjust the battery limit.
# Adjust the dimmed brightness level.
then echo 50 > /sys/class/backlight/acpi_video0/brightness
fi
upower -i $(upower -e | grep BAT) | grep --color=never -E percentage|xargs|cut -d' ' -f2|sed s/%//
– rubo77 Jul 02 '14 at 09:07