all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrew Cohen <acohen@ust.hk>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 63620@debbugs.gnu.org
Subject: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake
Date: Mon, 05 Jun 2023 21:06:37 +0800	[thread overview]
Message-ID: <87y1ky83du.fsf@ust.hk> (raw)
In-Reply-To: <87lehinlvg.fsf@gmx.de> (Michael Albinus's message of "Sun, 21 May 2023 10:12:51 +0200")

[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]

Dear Michael

>>>>> "MA" == Michael Albinus <michael.albinus@gmx.de> writes:

[...]

    MA> Using D-Bus is just an implementation detail. What you want are
    MA> handlers, which are invoked when your laptop falls asleep or
    MA> awakes.

Yes, of course you are right!

    MA> A general package could implement it using D-Bus if available,
    MA> or using something else if there's no D-Bus. See battery.el,
    MA> which uses the D-Bus service "org.freedesktop.UPower" only if
    MA> possible. Your package might be called sleep.el or alike.

I am not familiar with other methods for detecting sleep/wake, so I just
have dbus at the moment. But if anyone knows of something else
(especially on windows) it can then be added.

[...]

MA> I would make it rather a global minor mode, that you can
MA> enable/disable it easily.

Yes, that is a better idea. 

[...]

    MA> Perhaps, you check also for the service
    MA> "org.freedesktop.login1", like

    MA> (member "org.freedesktop.login1" (dbus-list-activatable-names
    MA> :system))

OK, added.


I've now put everything together and modified the gnus code to use the
new sleep.el. But I remain unsure if I should remove gnus-dbus.el
entirely (everything remains the same for the user: setting
gnus-dbus-close-on-sleep to a non-nil value will enable the feature
using the global minor mode rather than gnus-dbus).  And is sleep.el
something worth adding?


[-- Attachment #2: sleep.el --]
[-- Type: application/emacs-lisp, Size: 3425 bytes --]

[-- Attachment #3: Type: text/plain, Size: 19 bytes --]



-- 
Andrew Cohen

  reply	other threads:[~2023-06-05 13:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20 23:19 bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake Andrew Cohen
2023-05-21  8:12 ` Michael Albinus
2023-06-05 13:06   ` Andrew Cohen [this message]
2023-06-10 10:47     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1ky83du.fsf@ust.hk \
    --to=acohen@ust.hk \
    --cc=63620@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.