Subject: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake

From: Michael Albinus <[email-masked]>
Date: Fri, 07 Feb 2025 09:30:32 +0100

Andrew Cohen <[email-masked]> writes:

Hi Andrew,

>     MA> Another idea: There are the properties Docked, LidClosed and
>     MA> OnExternalPower. Perhaps you could check them in your
>     MA> sleep-handler, and start different actions depending on their
>     MA> value.
>
> That is a good idea. We could generalize the mode to handle a variety of
> things other than sleep. Maybe we should use a new event category
> (<system-event> or something) rather than sleep-event. This general
> event can contain actions for sleep, docked, lidclosed, etc. And we
> provide a mode for system-event, with sleep just one of the actions. For
> D-Bus, this becomes pretty trivial---we just inject all the events we
> are interested into system-event and have an appropriate handler.

Yes, that's more or less the direction I was thinking of. I'm just
polishing my patch, will push it later today. I still keep the event
name sleep-event; we can change it later to system-event. But it should
be sufficient for now, for your tests and proposed patches for review.

What I'll appreciate is, if you could write down what system-event would
be good for, and which attributes a (system-event ...) event shall
carry. However, this is rather a discussion for the [email-masked]
ML, in order to get more attention from the Emacs developers.

> I must say, I hadn't fully appreciated all that can be done with
> D-Bus.

😊

> Best,
> Andy

Best regards, Michael.