Re: [ACPI-sppt] Problems with Event-catching in acpid
Sebastian Henschel <[email protected]>
| Newsgroups | gmane.linux.acpi.support |
|---|---|
| Message-ID | <[email protected]> |
hi swen.. Received at 2003-06-11 / 09:04 by Swen: > > I had a problem with the acpid-tool. It doesn't work, so i want! in > /var/log/acpid the events where shown correctly. I had create a file > /etc/acpi/events/power wich contents > > event=button/power.* > action=/etc/acpi/scripte/power.sh i remember there was an alternative in the regexp like event=button[/ ]power.* in my power-event, but this could be wrong. anyway, i now use only the default event which catches all: event=.* action=/etc/acpi/default.sh %e the event parsing is done in that script, check the attached default.sh hth, sebastian -- ::: sebastian henschel ::: kodeaffe ::: lynx -source http://www.kodeaffe.de/shensche.pub | gpg --import
default.sh
(application/x-sh, 804 B)
#!/bin/sh
# Default acpi script that takes an entry for all actions
set $*
# Take care about the way events are reported
ev_type=`echo "$1" | cut -d/ -f1`
if [ "$ev_type" = "$1" ]; then
event="$2";
else
event=`echo "$1" | cut -d/ -f2`
fi
case "$ev_type" in
button)
case "$event" in
power)
# logger "acpid powerbtn called: $*"
/etc/acpi/powerbtn.sh $*
;;
*)
logger "acpid default: event $event is not defined"
;;
esac
;;
battery)
case "$event" in
*)
logger "acpid default: event $event is not defined"
;;
esac
;;
*)
logger "acpid default: ACPI group $1 / event $2 is not defined"
;;
esac
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+5vBEreHfL3pi+bQRAoBRAJ47sX74qWWM70tosSYH0o+IcjG+pACeIomm qO+daUyWHYbkHAiZiT4AE20= =zASs -----END PGP SIGNATURE-----