Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an easy way of having tea-time display messages via gnome's native notification system?

The current "notification function" in tea-time.el is:

(defun show-notification (notification)
  "Show notification. Use mumbles."
 (if (program-exists "mumbles-send")
    (start-process "tea-time-mumble-notification" nil "mumbles-send" notification)
  (message notification)

I tried editing this to use notify-send instead, without any success: specifically using something like (shell-command (concat "notify-send " notification)) in place of (start-process "tea-time-mumble-notification" nil "mumbles-send" notification) doesn't seem to work (I got rid of the if-statement as well, of course).


share|improve this question

Yes, just call notify-send command from the alert hook (if there is one, otherwise you might need to patch tea-time to have that.)

share|improve this answer
Thanks. I added more info in my original question: suggestions on how to call notify-send? – emacsomancer Jun 6 '11 at 16:26
No idea. Care to ask/search on some Emacs forum or search through emacswiki.org? – alex Jun 6 '11 at 16:37
@BeSlayed :perhaps, redefine the cited function to use the suggested notify-send (instead of that mumbles-send)? – imz -- Ivan Zakharyaschev Jun 6 '11 at 17:46
@imz: yes, I have tried (defun show-notification (notification) (shell-command (concat "notify-send " notification) )) (which seems like what you're suggesting), but I get a "Invalid number of options" error. – emacsomancer Jun 7 '11 at 2:01
up vote 1 down vote accepted

By trial and error I figured out that the following redefinition works:

(defun show-notification (notification)
"Show notification. Use notify-send."
(start-process "tea-time-notify-notification" nil "notify-send" notification)

Fancier stuff can be done as well: using

(start-process "tea-time-notify-notification" nil "notify-send" "-i" (expand-file-name "~/path/to/your/icon/YourIconName.png") "Emacs Tea Timer" notification)

tells the notification daemon to use an icon (this one is suitable) in the notification pop-up and uses a emboldened 'summary' text ("Emacs Tea Timer").

share|improve this answer

With the latest tea-time.el, you have a hook you can use for that.
Add to your Emacs initialization:

(add-hook 'tea-time-notification-hook 
  (function (lambda() 
    (start-process "tea-timer-notification" nil "notify-send" "Time is up!"))))
share|improve this answer

In Emacs 24, you can use notifications.el to send D-Bus notifications directly from elisp code. Rewriting @yhager's hook, above:

(add-hook 'tea-time-notification-hook
  (lambda ()
    (notifications-notify :title "Time is up!"
                          :body "I know you're busy, but it's TEA TIME!!"
                          :app-name "Tea Time"
                          :sound-name "alarm-clock-elapsed)))

There are more useful args described on the Notifications page of the Emacs Lisp Reference Manual (including the :sound-file option, instead of :sound-name, which requires an XDG sound theme implementation).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.