Re: [ACPI-sppt] capturing events with acpid

Luca Capello <[email protected]> Sat, 11 Oct 2003 12:45:23 +0100
Newsgroups gmane.linux.acpi.support
Message-ID <[email protected]>
Hello Ben,

from the 'acpi4asus' README:

=====
- asus_acpid, a user-level daemon, based on acpid, to handle events 
generated by the kernel module. This daemon is only provided as an 
example, you can use any tool you want, as all events reported by the 
driver are inserted in the /proc/acpi/event queue. So, if you want, you 
can use the regular acpid. The advantage of this daemon is that it can 
be launched by any user, and so, interact directly with the X session 
opened by this user. You may then be able to launch X programs with this 
daemon, whereas with the classical ACPI daemon, this is not possible easily.

[...]

  4.2 asus_acpid daemon

Now, you have to get a program than can handle events reported by the 
kernel module. The ACPID daemon is perfect for this, it is certainly 
packaged for your distribution, so I suggest you install it. Then you 
have two solutions: handle the events generated by hotkeys directly in 
the acpid configuration files (generally situated in /etc/acpid/), or 
with an alternate daemon. As I mentioned earlier, the advantage of the 
alternate daemon is that is can be launched by a non privileged user and 
interact directly with the environment of this user, that is you can 
bind one of your hotkeys to an Xterm if you wish, what is impossible 
with the acpid daemon without making dirty hacks...
=====

So, the problem is that you're trying to start an X-program as 'user', 
while the 'acpid' starts it as 'privileged' user and this is the reason 
why you have the Xlib problem.

First solution: this is the same I adopted for my 'acpi4asusconf' tool 
at http://luca.pca.it/projects/asus/acpi4asusconf/, but to have 
different configuration for different users is quite impossibile. You 
just need to add the option "-m 777" to file /etc/init.d/acpid section 
'start daemon': in this way, the acpid socket will have permissions 777 
(everyone can do everything) and you should be able to start what you 
want pressing the 'email' hotkey or every hotkeys you want.

Second solution: use the 'asus_acpid' :-)

Third solution: wait a moment I'll release the new version of my tool, 
which will have the possibility to choose between general configuration 
(using the 'acpid') and user ones (using 'asus_acpid').

Thx, bye,
Gismo / Luca



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php