# [SOLVED] Numeric acpi events - how to catch them?

## widlokm

Hello,

I'm using Lenovo T400 laptop with THINKPAD_ACPI kernel module enabled. This driver can pass to user space acpi events related to battery/hardware state of the laptop like:

(taken from linux/Documentation/laptops/thinkpad-acpi.txt):

0x2313 ALARM: System is waking up from suspend because battery is near empty

The question is: How to catch this even with acpid?

For typical events like buttons the line in /etc/acpi/events/button-something file is:

```
event=button/sleep

action=/etc/acpi/button_sleep.sh

```

How to create event and action for this battery alarm? Should it be something like:

```
event=0x2313

action=/etc/acpi/battery_alarm.sh

```

Thanks in advance

Best Regards,

Michael WidlokLast edited by widlokm on Fri May 26, 2017 6:20 am; edited 1 time in total

----------

## Dr.Willy

 *manpage wrote:*   

> The event value is a regular expression (see  regcomp(3)),  against  which  events  are matched.

 

----------

## widlokm

The acpid manual was the first place where I wanted to find the answer, unfortunately it does not tell me what the event will be. A string "0x2313" a number? All examples I found during long searching are only for buttons.  So more generic: How the "event=" line should look like to catch numeric events?

----------

## Dr.Willy

 *widlokm wrote:*   

> The acpid manual was the first place where I wanted to find the answer, unfortunately it does not tell me what the event will be. A string "0x2313" a number?

 

Regexprs are used to match strings, so it must be a string.

----------

## s4e8

According to the doc, the event format/string is

ibm/hotkey HKEY 00000080 0000xxxx

for your case is:

ibm/hotkey HKEY 00000080 00002313

----------

## widlokm

Thank You s4e8, that's it.

----------

