[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bind keyboard POWER button to start some program



On Friday 21 July 2006 15:58, Vladi Lemurov wrote:
> Hello!
> How can one bind a keyboard key (in my case I would like to bind
> keyboard POWER button to /etc/init.d/poweroff script) or key sequence
> (i.e. ctrl + f1)
> to a script launch or something. For example one pushes keyboard POWER
> BUTTON and the script /etc/init.d/poweroff is being started.

[...]

If you use ACPI, you can create /etc/acpi/events/powerbtn containing:

	event=button[ /]power
	action=/etc/acpi/powerbtn.sh

where powerbtn.sh is the shutdown script that comes with acpid.

Any ACPI event can be used to trigger any command in this way, see man acpid.

HTH,

John



Reply to: