2 # /etc/acpid/actions/battery.sh
3 # based on work by Frank Dietrich <ablesoft@gmx.de>
5 # Detect AC connector plugged in or unplugged and take appropriate actions.
12 # get the AC connector state from /proc filesystem.
13 STATE=`sed -n 's/^.*\(off\|on\)-line.*/\1/p' /proc/acpi/ac_adapter/AC/state`
17 # AC connector plugged in
18 logger "acpid: AC connector plugged in."
19 # deactivate standby (spindown) timeout for the drive
20 #hdparm -q -S 0 /dev/hda
22 #echo 0 > /proc/acpi/processor/CPU0/throttling
23 #echo 0 > /proc/acpi/processor/CPU0/performance
26 # AC connector unplugged
27 logger "acpid: AC connector unplugged."
28 # activate standby (spindown) timeout for the drive
29 # timeout 5 minutes (man hdparm, for more informations)
30 #hdparm -q -S 60 /dev/hda
32 #echo 4 > /proc/acpi/processor/CPU0/throttling
33 #echo 3 > /proc/acpi/processor/CPU0/performance
36 # AC connector in undetermined state
37 logger "acpid: Could not determine new AC connector state."