[systemd-devel] diverting HandlePowerKey

Lennart Poettering lennart at poettering.net
Thu Aug 16 07:37:13 PDT 2012


On Thu, 16.08.12 14:47, Mantas Mikulėnas (grawity at gmail.com) wrote:

> On Thu, Aug 16, 2012 at 2:23 PM, Robin Becker <robin at reportlab.com> wrote:
> > However, on my netbooks I like to use the power button to launch oblogout
> > which brings up a bunch of buttons that allow me to
> > logout/suspend/restart/halt etc etc. I can of course continue to use acpid
> > to handle the power button, but that seems opposed to the spirit of systemd.
> 
> acpid is still okay, I believe. Even though it comes with a single
> shell script for all actions, it is not part of boot process, and it's
> not a required part of acpid either – acpid actually has a built-in
> filtering mechanism in /etc/acpi/events, and the shell script is just
> default configuration.
> 
> However, running X11 programs from a daemon, regardless whether it it
> is logind or acpid, is not recommended. Sure, it might be okay for a
> single-user machine, but I have ended up with two, three X servers
> fairly often even on my personal laptop.
> 
> It'd be a bit better if the button/lid events were handled by a
> program running inside the Openbox session (the events can be read
> from /run/acpid.socket).

No, nobody should use the acpid client protocol for this. 

On Linux ACPI key presses are processed like any other keys, and thus
are propagated to the X server. The desktop environment should handle
these keys and then do whatever is necessary (show a dialog box, react
immediatey, ...).

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list