- 论坛徽章:
- 0
|
acpid is designed to notify user-space programs of ACPI events. acpid should be started during the system boot,
and will run as a background process, by default. It will open an events file (/proc/acpi/event by default) and
attempt to read whole lines. When a line is received (an event), acpid will examine a list of rules, and execute
the rules that match the event.
Rules are defined by simple configuration files. acpid will look in a configuration directory (/etc/acpi/events
by default), and parse all files that do not begin with a period (’.’). Each file must define two things: an
event and an action. Any blank lines, or lines where the first character is a pound sign (’#’) are ignored.
Extraneous lines are flagged as warnings, but are not fatal. Each line has three tokens: the key, a literal
equal sign, and the value. The key can be up to 63 characters, and is case-insensitive (but whitespace matters).
The value can be up to 511 characters, and is case and whitespace sensitive.
这些事件不一定是电源管理按钮,比如我的系统中在/etc/acpid/events下面就有:
[root@localhost ~]# ls /etc/acpi/events/
ac asus-media-prev ibm-hibernatebtn panasonic-hibernatebtn sony-mute tosh-media
asus-a6j-touchpad asus-media-stop ibm-lockbtn panasonic-lockbtn sony-sleep tosh-mute
asus-internet asus-touchpad ibm-sleepbtn panasonic-sleepbtn sony-volume-down tosh-next
asus-lock asus-volume-down ibm-videobtn powerbtn sony-volume-up tosh-play
asus-mail asus-volume-mute ibm-wireless sleepbtn tosh-brightness-down tosh-prev
asus-media-eject asus-volume-up lidbtn sony-brightness-down tosh-brightness-up tosh-sleep
asus-media-next asus-wireless panasonic-brightness-down sony-brightness-up tosh-hibernate tosh-stop
asus-media-play-pause battery panasonic-brightness-up sony-hibernate tosh-lock tosh-wireless
这么多按钮的事件处理。不过你应该是要kernel module的配合的 |
|