[ltp] thinkpad-acpi and power button timeout

Michael Topp info at mito-space.com
Thu Mar 4 18:15:08 CET 2021


-- tpb is not limited to X and has access to the special hardcoded
buttons -->

$ sudo LANG=C tpb --help
tpb 0.6.4 (C) 2002-2005 Markus Braun

Usage: tpb options

options:
   -h, --help           display this help
   -d, --daemon         start in daemon mode
   -c, --config=FILE    read FILE as additional configuration file
   -m, --mixer=STATE    use OSS software mixer [off]
   -o, --osd=STATE      show informations as on-screen display [on]
   -p, --poll=DELAY     set delay between polls in microseconds [200000]
   -t, --thinkpad=CMD   string with command and options that should be
executed
                        when ThinkPad button is pressed [none]
   -H, --home=CMD       command and options for Home button [none]
   -S, --search=CMD     command and options for Search button [none]
   -M, --mail=CMD       command and options for Mail button [none]
   -W, --wireless=CMD   command and options for Wireless button [none]
   -C, --callback=CMD   string with command that should be executed for each
                        pressed button. It is called with pressed button as
                        first argument and new state as second [none]
   -A, --apm=STATE      poll /proc/apm for apm information [off]
   -P, --powermgt=STATE display of power management messages [auto]
   -x, --xevents=STATE  grab X11 events of special keys [on]
   -v, --verbose        print information about pressed keys

It creates and/or reads /dev/nvram. Works for me; yet this app might be
too old for your box, though.

Alternatively you could look into your BIOS. Besides, thinkwiki.org will
probably tell you more about your machine.

M


Am 03.03.21 um 23:12 schrieb Ivan J.:
> On Wed, Mar 03, 2021 at 08:01:06PM +0100, Michael Topp wrote:
>> Am 03.03.21 um 12:11 schrieb Ivan J.:
>>> Hi,
>>>
>>> I'm trying to interact with the power button and the ACPI event it
>>> generates on a Thinkpad X270. It seems to me that it is necessary
>>> to hold the power button for 1+ seconds in order for it to actually
>>> register with ACPI and produce an event.
>>>
>>> Does anyone know if it's possible to lower or even disable this
>>> timeout so the event would be registered "instantly" when the power
>>> button is pressed?
>>>
>>> Best regards,
>>> Ivan
>> Hi Ivan,
>>
>> maybe you can reconfigure that key with xev/xbindkeys; cf. Arch Wiki:
>> https://wiki.archlinux.org/index.php/Xbindkeys
>>
>> Or look for "tpb" (Thinkpad buttons), also for your model; cf. AUR:
>> https://aur.archlinux.org/packages/tpb , and check out the "savannah"
>> links. – IIRC it can even handle more buttons than the few mentioned.
>>
>> Michael
>>
> My issue is lower-level than this. Both xev and tpb work on the Xorg
> layer and can not influence this timeout. What I am looking for is
> something system-wide. I've also looked in the thinkpad-acpi kernel
> source, but I haven't seen anything obvious that would explain the
> timeout/duration of the button press.
>
> Now I wonder if Lenovo made it so in the hardware...
>
> Best regards,
> Ivan
>



More information about the Linux-Thinkpad mailing list