all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Peter Münster" <pmlists@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: notifications-notify resets idle-time
Date: Sun, 04 Mar 2012 22:24:14 +0100	[thread overview]
Message-ID: <87fwdogiv5.fsf@micropit.couberia.bzh> (raw)
In-Reply-To: 87k43pycii.fsf@gmx.de

On Tue, Feb 14 2012, Michael Albinus wrote:

>>> Wouldn't it suffice just to deregister signal "NotificationClosed"?
>>
>> How? With dbus-unregister-service?
>
> Yes.

It seems, that I rather need dbus-unregister-object, because I only want
to unregister the closed-signal, not the action-signal. So I patched
notifications.el:

--8<---------------cut here---------------start------------->8---
--- notifications.el~	2012-03-04 22:00:27.851590759 +0100
+++ notifications.el	2012-03-04 22:00:43.625016422 +0100
@@ -96,6 +96,12 @@
 This must be kept, because the notification daemon could be
 restarted, and the registered signals cannot be identified anymore.")
 
+(defvar notifications-action-signal-object nil
+  "Object of the registration of the action signal.")
+
+(defvar notifications-closed-signal-object nil
+  "Object of the registration of the closed signal.")
+
 (defun notifications-on-action-signal (id action)
   "Dispatch signals to callback functions from `notifications-on-action-map'."
   (let ((entry (assoc id notifications-on-action-map)))
@@ -106,13 +112,14 @@
       (remove entry 'notifications-on-action-map))))
 
 (when (fboundp 'dbus-register-signal)
-  (dbus-register-signal
-   :session
-   nil
-   notifications-path
-   notifications-interface
-   notifications-action-signal
-   'notifications-on-action-signal))
+  (setq notifications-action-signal-object
+        (dbus-register-signal
+         :session
+         nil
+         notifications-path
+         notifications-interface
+         notifications-action-signal
+         'notifications-on-action-signal)))
 
 (defun notifications-on-closed-signal (id &optional reason)
   "Dispatch signals to callback functions from `notifications-on-closed-map'."
@@ -128,13 +135,14 @@
       (remove entry 'notifications-on-close-map))))
 
 (when (fboundp 'dbus-register-signal)
-  (dbus-register-signal
-   :session
-   nil
-   notifications-path
-   notifications-interface
-   notifications-closed-signal
-   'notifications-on-closed-signal))
+  (setq notifications-closed-signal-object
+        (dbus-register-signal
+         :session
+         nil
+         notifications-path
+         notifications-interface
+         notifications-closed-signal
+         'notifications-on-closed-signal)))
 
 (defun notifications-notify (&rest params)
   "Send notification via D-Bus using the Freedesktop notification protocol.
--8<---------------cut here---------------end--------------->8---

And in my init.el I do now:
--8<---------------cut here---------------start------------->8---
(require 'notifications)
(dbus-unregister-object notifications-closed-signal-object)
--8<---------------cut here---------------end--------------->8---


> I have played with the other woraround option, reusing the notification
> window. The following code snippet, based on your initial example, shall
> give you an idea:

I understand: instead of closing the window, you replace it by another
and no event is sent to emacs. But it does not really fit my needs:
Now I use https://github.com/p-m/org-notify with a personal setup that
opens notification pop-ups once per minute with a timeout of 10 seconds
for example.

-- 
           Peter




  reply	other threads:[~2012-03-04 21:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 22:08 notifications-notify resets idle-time Peter Münster
2012-02-11  9:57 ` Michael Albinus
2012-02-11 11:38   ` Peter Münster
2012-02-11 12:40     ` Michael Albinus
2012-02-11 12:51       ` Peter Münster
2012-02-11 16:00         ` Michael Albinus
2012-02-11 16:38           ` Peter Münster
2012-02-11 17:26             ` Michael Albinus
2012-02-11 19:06               ` Peter Münster
2012-02-12  9:16                 ` Michael Albinus
2012-02-12 11:09                   ` Peter Münster
2012-02-12 11:59                     ` Michael Albinus
2012-02-12 20:37                       ` Peter Münster
2012-02-12 21:17                         ` Michael Albinus
2012-02-13  8:29                           ` Peter Münster
2012-02-13 11:53                             ` Michael Albinus
2012-02-13 15:42                               ` Peter Münster
2012-02-13 16:43                                 ` Michael Albinus
2012-02-13 23:13                                   ` Peter Münster
2012-02-14  9:45                                     ` Michael Albinus
2012-03-04 21:24                                       ` Peter Münster [this message]
2012-03-05 14:51                                         ` Michael Albinus
2012-03-06 10:34                                         ` Michael Albinus
2012-03-06 14:53                                           ` Peter Münster
2012-03-07  7:58                                             ` 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=87fwdogiv5.fsf@micropit.couberia.bzh \
    --to=pmlists@free.fr \
    --cc=help-gnu-emacs@gnu.org \
    /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.