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

From: Michael Albinus <[email-masked]>
Date: Tue, 04 Feb 2025 16:38:34 +0100

Eli Zaretskii <[email-masked]> writes:

>> Once an API is agreed in principle, I'd be willing to take a stab at an NS implementation for sleep/wake
>> events to exercise the API, and so we'd have both dbus and NS. On macOS, it's basically "will sleep" and
>> "did wake" events, and I don't think there's a hibernate event.
>
> What I had in mind is basically to have the D-Bus handler push a
> special event onto unread-command-events, and then that event could be
> bound to a command.
>
> Michael and Stefan, does it make sense to work like that with D-Bus?

Sure, no problem for D-Bus. This could be done in sleep-handler, instead
of running sleep-sleep-hook and sleep-wake-hook.

The event should have a boolean argument, for on/off (or sleep/wake,
however we name it).

Best regards, Michael.