acpid: improve handler script.
- Accept PBTN/SLPB events too; power button now works in the BBB. - Accept open/close LID events.
This commit is contained in:
parent
ecfab7fa4c
commit
d75fb70b52
|
@ -14,13 +14,19 @@ case "$1" in
|
|||
button/power)
|
||||
#echo "PowerButton pressed!">/dev/tty5
|
||||
case "$2" in
|
||||
PWRF) logger "PowerButton pressed: $2" ;;
|
||||
PBTN|PWRF)
|
||||
logger "PowerButton pressed: $2"
|
||||
shutdown -h -P now
|
||||
;;
|
||||
*) logger "ACPI action undefined: $2" ;;
|
||||
esac
|
||||
;;
|
||||
button/sleep)
|
||||
case "$2" in
|
||||
SLPB) echo -n mem >/sys/power/state ;;
|
||||
SBTN|SLPB)
|
||||
logger "Sleep Button pressed: $2"
|
||||
echo -n mem >/sys/power/state
|
||||
;;
|
||||
*) logger "ACPI action undefined: $2" ;;
|
||||
esac
|
||||
;;
|
||||
|
@ -57,8 +63,11 @@ case "$1" in
|
|||
esac
|
||||
;;
|
||||
button/lid)
|
||||
#echo "LID switched!">/dev/tty5
|
||||
;;
|
||||
case "$3" in
|
||||
close) logger "LID closed" ;;
|
||||
open) logger "LID opened" ;;
|
||||
*) logger "ACPI action undefined (LID): $2";;
|
||||
esac
|
||||
*)
|
||||
logger "ACPI group/action undefined: $1 / $2"
|
||||
;;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
# Template file for 'acpid'
|
||||
pkgname=acpid
|
||||
version=2.0.23
|
||||
revision=2
|
||||
replaces="runit-void<20141013_2"
|
||||
revision=3
|
||||
build_style=gnu-configure
|
||||
conf_files="/etc/acpi/events/anything /etc/acpi/handler.sh"
|
||||
short_desc="The ACPI Daemon (acpid) With Netlink Support"
|
||||
|
@ -13,9 +12,6 @@ distfiles="${SOURCEFORGE_SITE}/acpid2/acpid-$version.tar.xz"
|
|||
checksum=4396aaec13510c3a1faa941a15a4b5335b6ae4fbec8438b9249b88c3b66187ee
|
||||
|
||||
build_options="systemd"
|
||||
if [ "$build_option_systemd" ]; then
|
||||
systemd_services="acpid.socket on"
|
||||
fi
|
||||
|
||||
post_install() {
|
||||
if [ "$build_option_systemd" ]; then
|
||||
|
|
Loading…
Reference in New Issue