[systemd-devel] How do I hook into ACPI events?

Mason Loring Bliss mason at blisses.org
Thu May 26 21:12:46 UTC 2016


Traditionally I could edit scripts in /etc/acpi to accomplish things, but on
EL7 I'm seeing that some combination of upower and systemd/logind appear to
be the way to control responses to ACPI events.

I want to have custom things happen on lid close, and I'm not seeing how to
accomplish it as yet.

logind.conf(5) and the web page at
https://www.freedesktop.org/software/systemd/man/logind.conf.html both
enumerate the options for HandleLidSwitch:

     Can be one of "ignore", "poweroff", "reboot", "halt", "kexec",
    "suspend", "hibernate", "hybrid-sleep", and "lock". If "ignore", logind
     will never handle these keys.

I thought at first kexec was a way I might hook in behaviour, but now I see
that kexec is for fast reboots. Nothing else seems appropriate there.

How can I do this? The default RHEL7 Gnome seems to be able to inject custom
behaviour, as it locks the screen on lid close before sleep, but it's not yet
clear how they do it.

Thanks in advance for clues.

-- 
Mason Loring Bliss          mason at blisses.org          Ewige Blumenkraft!
awake ? sleep : random() & 2 ? dream : sleep; -- Hamlet, Act III, Scene I
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160526/2b2dbfae/attachment.sig>


More information about the systemd-devel mailing list