mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-29 17:02:56 +02:00
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
2 changed files with 14 additions and 9 deletions
|
@ -14,13 +14,19 @@ case "$1" in
|
||||||
button/power)
|
button/power)
|
||||||
#echo "PowerButton pressed!">/dev/tty5
|
#echo "PowerButton pressed!">/dev/tty5
|
||||||
case "$2" in
|
case "$2" in
|
||||||
PWRF) logger "PowerButton pressed: $2" ;;
|
PBTN|PWRF)
|
||||||
|
logger "PowerButton pressed: $2"
|
||||||
|
shutdown -h -P now
|
||||||
|
;;
|
||||||
*) logger "ACPI action undefined: $2" ;;
|
*) logger "ACPI action undefined: $2" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
button/sleep)
|
button/sleep)
|
||||||
case "$2" in
|
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" ;;
|
*) logger "ACPI action undefined: $2" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
@ -57,8 +63,11 @@ case "$1" in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
button/lid)
|
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"
|
logger "ACPI group/action undefined: $1 / $2"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
# Template file for 'acpid'
|
# Template file for 'acpid'
|
||||||
pkgname=acpid
|
pkgname=acpid
|
||||||
version=2.0.23
|
version=2.0.23
|
||||||
revision=2
|
revision=3
|
||||||
replaces="runit-void<20141013_2"
|
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
conf_files="/etc/acpi/events/anything /etc/acpi/handler.sh"
|
conf_files="/etc/acpi/events/anything /etc/acpi/handler.sh"
|
||||||
short_desc="The ACPI Daemon (acpid) With Netlink Support"
|
short_desc="The ACPI Daemon (acpid) With Netlink Support"
|
||||||
|
@ -13,9 +12,6 @@ distfiles="${SOURCEFORGE_SITE}/acpid2/acpid-$version.tar.xz"
|
||||||
checksum=4396aaec13510c3a1faa941a15a4b5335b6ae4fbec8438b9249b88c3b66187ee
|
checksum=4396aaec13510c3a1faa941a15a4b5335b6ae4fbec8438b9249b88c3b66187ee
|
||||||
|
|
||||||
build_options="systemd"
|
build_options="systemd"
|
||||||
if [ "$build_option_systemd" ]; then
|
|
||||||
systemd_services="acpid.socket on"
|
|
||||||
fi
|
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
if [ "$build_option_systemd" ]; then
|
if [ "$build_option_systemd" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue