SoniX
18th January 2007, 04:18 PM
I made myself this battery script:
#!/bin/sh
# Using the script to change brigtness when going to battery mode
ACAD_BRIGHTNESS=21
BATT_BRIGHTNESS=5
# ac/battery event handler
status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/ADP1/state`
case $status in
"on-line")
logger "Changing brightness to ACAD level"
/usr/bin/smartdimmer --set=$ACAD_BRIGHTNESS
exit 0
;;
"off-line")
logger "Changing brightness to BATT level"
/usr/bin/smartdimmer --set=$BATT_BRIGHTNESS
exit 0
;;
esac
Placed it into /etc/acpi/actions and made it executable!
Made myself this conf file
# Battery configuration
# Written by SoniX
#event=battery.*
#action=/etc/acpi/actions/battery.sh
Placed it into /etc/acpi/events
Reloaded the acpid deamon but this doesn't seem to work... Any idea's?
#!/bin/sh
# Using the script to change brigtness when going to battery mode
ACAD_BRIGHTNESS=21
BATT_BRIGHTNESS=5
# ac/battery event handler
status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/ADP1/state`
case $status in
"on-line")
logger "Changing brightness to ACAD level"
/usr/bin/smartdimmer --set=$ACAD_BRIGHTNESS
exit 0
;;
"off-line")
logger "Changing brightness to BATT level"
/usr/bin/smartdimmer --set=$BATT_BRIGHTNESS
exit 0
;;
esac
Placed it into /etc/acpi/actions and made it executable!
Made myself this conf file
# Battery configuration
# Written by SoniX
#event=battery.*
#action=/etc/acpi/actions/battery.sh
Placed it into /etc/acpi/events
Reloaded the acpid deamon but this doesn't seem to work... Any idea's?