You are not logged in.
I have been unable to trigger an event when the power button is pressed on my laptop.
# uname -a
Linux julia 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 08:53:25 CEST 2011 x86_64 AMD Turion(tm) 64 X2 Mobile Technology TL-50 AuthenticAMD GNU/Linux
acpid version 2.0.10-2, started through rc.conf as daemon.
dbus is active, HAL is not installed.
# tail -f /var/log/messages.log
Sep 6 14:48:03 localhost -- MARK --
Sep 6 15:08:03 localhost -- MARK --
Sep 6 15:28:03 localhost -- MARK --
Sep 6 15:36:02 localhost acpid: client 1328[0:100] has disconnected
Sep 6 15:36:02 localhost acpid: client connected from 2084[0:100]
Sep 6 15:36:02 localhost acpid: 1 client rule loaded
Sep 6 15:48:03 localhost -- MARK --
Sep 6 16:08:03 localhost -- MARK --
Sep 6 16:28:03 localhost -- MARK --
Sep 6 16:48:03 localhost -- MARK --
Sep 6 16:59:43 localhost logger: PowerButton pressed: PWRF
# acpi_listen
button/power PWRF 00000080 00000002
That output indicates the power button is recognized by the kernel, but it have no idea what i should put in /etc/acpi/handler.sh to shutdown the laptop when the powerbutton is pressed.
Last edited by Lone_Wolf (2011-09-07 12:02:23)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
acpid receives the button press event (see your acpi_listen output)
Have you investigated the handler.sh and read acpid (ArchWiki)? You specify a (list of) command(s) in the case-construct (e.g. invoke /sbin/shutdown).
Offline
I have read the wiki (the tail and acpi_listen commands come directly from the wiki page).
My problem is what to put as condition for the case statement.
button/power and button/PWRF have no effect.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
button/power PWRF 00000080 00000002
These are the arguments passed to the handler script ($1 to $4).
handler.sh from acpid package:
case "$1" in
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PBTN|PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
Replace the logger "PowerButton [...]" command (which is responsible for the message.log line you quote) with a shutdown invocation.
Offline
It turns out i had to use PWRF as $2 in handler.sh to make things work.
I edited the acpid wiki page to make the relation between acpi-listen and the handler.sh parameters clearer.
Thanks for the help, Jakobm.
case "$1" in
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF) poweroff ;;
*) logger "ACPI action undefined: $2" ;;
esac
Solved
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline