hacker emblem

Submitted by admin on Fri, 2005-09-30 21:37.
just put a file in /etc/acpi/events for the battery and ac_adapter ACPI events (if you have laptop-mode-tools installed you can add the action lines to the two files already there called lm_ac_adapter and lm_battery):
event=battery.*
action=/etc/acpi/actions/brightness.sh battery

event=ac_adapter
action=/etc/acpi/actions/brightness.sh ac
and then put into /etc/acpi/actions/brightness.sh something like:
#!/bin/bash

# levels are from 0 (very dark) to 7 (very bright)
BATT_LEVEL=0
AC_LEVEL=7

case "$1" in
        battery)
                echo "level $BATT_LEVEL" > /proc/acpi/ibm/brightness
                ;;
        ac)
                echo "level $AC_LEVEL" > /proc/acpi/ibm/brightness
                ;;
esac

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
The content of this field is kept private and will not be shown publicly.
  • Textual smileys will be replaced with graphical ones.
  • Lines and paragraphs break automatically.
More information about formatting options