aboutsummaryrefslogtreecommitdiff
path: root/system/etc/acpi/handler.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-04-03 20:42:16 +0200
committerKarel Kočí <cynerd@email.cz>2017-04-03 20:42:16 +0200
commit81836945a63f726033fb6550755e2c9dbf1a1f83 (patch)
tree4202b3b9fdfaf7013660302750b461c3570e2e81 /system/etc/acpi/handler.sh
parent151158101618f9392af1e65c4012c90dda3b437f (diff)
downloadmyconfigs-81836945a63f726033fb6550755e2c9dbf1a1f83.tar.gz
myconfigs-81836945a63f726033fb6550755e2c9dbf1a1f83.tar.bz2
myconfigs-81836945a63f726033fb6550755e2c9dbf1a1f83.zip
Add system_install
Diffstat (limited to 'system/etc/acpi/handler.sh')
-rwxr-xr-xsystem/etc/acpi/handler.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/system/etc/acpi/handler.sh b/system/etc/acpi/handler.sh
new file mode 100755
index 0000000..1cc28ff
--- /dev/null
+++ b/system/etc/acpi/handler.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+# Default acpi script that takes an entry for all actions
+
+case "$1" in
+ button/power)
+ case "$2" in
+ PBTN|PWRF)
+ logger 'PowerButton pressed'
+ ;;
+ *)
+ logger "ACPI action undefined: $2"
+ ;;
+ esac
+ ;;
+ button/sleep)
+ case "$2" in
+ SLPB|SBTN)
+ pm-suspend
+ logger 'SuspendButton pressed'
+ ;;
+ *)
+ logger "ACPI action undefined: $2"
+ ;;
+ esac
+ ;;
+ ac_adapter)
+ case "$2" in
+ AC|ACAD|ADP0)
+ case "$4" in
+ 00000000)
+ logger 'AC unpluged'
+ echo 1000 > /sys/class/backlight/intel_backlight/brightness
+ ;;
+ 00000001)
+ logger 'AC pluged'
+ echo 5273 > /sys/class/backlight/intel_backlight/brightness
+ ;;
+ esac
+ ;;
+ *)
+ logger "ACPI action undefined: $2"
+ ;;
+ esac
+ ;;
+ battery)
+ case "$2" in
+ BAT0)
+ case "$4" in
+ 00000000)
+ logger 'Battery online'
+ ;;
+ 00000001)
+ logger 'Battery offline'
+ ;;
+ esac
+ ;;
+ CPU0)
+ ;;
+ *) logger "ACPI action undefined: $2" ;;
+ esac
+ ;;
+ button/lid)
+ case "$3" in
+ close)
+ logger 'LID closed'
+ pm-suspend
+ ;;
+ open)
+ logger 'LID opened'
+ ;;
+ *)
+ logger "ACPI action undefined: $3"
+ ;;
+ esac
+ ;;
+ *)
+ logger "ACPI group/action undefined: $1 / $2"
+ ;;
+esac