summaryrefslogtreecommitdiffstats
path: root/abs/core/acpid/handler.sh.runit
diff options
context:
space:
mode:
authorMichael Hanson <hansonorders@verizon.net>2010-11-11 02:29:32 (GMT)
committerMichael Hanson <hansonorders@verizon.net>2010-11-11 02:29:32 (GMT)
commit2ca74b400de2bfe1f6330a9ea733901c91ea63e0 (patch)
treef77b7580b444a5fc15fae5585abe903bec212283 /abs/core/acpid/handler.sh.runit
parent011a51e55fab9635bd0be8dfc00e5666ea54c61c (diff)
downloadlinhes_pkgbuild-2ca74b400de2bfe1f6330a9ea733901c91ea63e0.zip
linhes_pkgbuild-2ca74b400de2bfe1f6330a9ea733901c91ea63e0.tar.gz
linhes_pkgbuild-2ca74b400de2bfe1f6330a9ea733901c91ea63e0.tar.bz2
acpid: update to 1.0.10
Diffstat (limited to 'abs/core/acpid/handler.sh.runit')
-rw-r--r--abs/core/acpid/handler.sh.runit68
1 files changed, 68 insertions, 0 deletions
diff --git a/abs/core/acpid/handler.sh.runit b/abs/core/acpid/handler.sh.runit
new file mode 100644
index 0000000..9fb2593
--- /dev/null
+++ b/abs/core/acpid/handler.sh.runit
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Default acpi script that takes an entry for all actions
+
+# NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to
+# modify it to not use /sys
+
+minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
+maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
+setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
+
+set $*
+
+case "$1" in
+ button/power)
+ #echo "PowerButton pressed!">/dev/tty5
+ case "$2" in
+ PWRF) logger "PowerButton pressed: $2"
+ /sbin/runit-init 0
+ /sbin/poweroff
+ ;;
+ *) logger "ACPI action undefined: $2" ;;
+ esac
+ ;;
+ button/sleep)
+ case "$2" in
+ SLPB) echo -n mem >/sys/power/state ;;
+ *) logger "ACPI action undefined: $2" ;;
+ esac
+ ;;
+ ac_adapter)
+ case "$2" in
+ AC)
+ case "$4" in
+ 00000000)
+ echo -n $minspeed >$setspeed
+ #/etc/laptop-mode/laptop-mode start
+ ;;
+ 00000001)
+ echo -n $maxspeed >$setspeed
+ #/etc/laptop-mode/laptop-mode stop
+ ;;
+ esac
+ ;;
+ *) logger "ACPI action undefined: $2" ;;
+ esac
+ ;;
+ battery)
+ case "$2" in
+ BAT0)
+ case "$4" in
+ 00000000) #echo "offline" >/dev/tty5
+ ;;
+ 00000001) #echo "online" >/dev/tty5
+ ;;
+ esac
+ ;;
+ CPU0)
+ ;;
+ *) logger "ACPI action undefined: $2" ;;
+ esac
+ ;;
+ button/lid)
+ #echo "LID switched!">/dev/tty5
+ ;;
+ *)
+ logger "ACPI group/action undefined: $1 / $2"
+ ;;
+esac