emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] tea-time?


From: Eric S Fraga
Subject: Re: [Orgmode] tea-time?
Date: Thu, 30 Jul 2009 11:56:53 +0100
User-agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj┼Ź) APEL/10.7 Emacs/23.0.96 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Wed, 29 Jul 2009 18:29:19 -0400,
Nick Dokos wrote:
> 
> Samuel Wales <address@hidden> wrote:
> 
> > Hi Bastien,
> > 
> > I did not realize that appt could not be used.
> > 
> > On 2009-07-29, Bastien <address@hidden> wrote:
> > > Please provide more information on how you tried it.
> > 
> > It works now.  I pulled in the interim, but I don't know if that's the
> > reason.  I tried it twice, so I don't think I missed the notification.
> > 
> > However, the notification is in the minibuffer / echo area, and can
> > easily be unnoticed if you are typing, as it goes away immediately.

Samuel,

you could investigate the linking of appt appointment notifications
with external display tools, such as libnotify and osd methods.  An
example is given by Richard Riley in this message in the mailing list
archives:

http://article.gmane.org/gmane.emacs.orgmode/8235

I use something similar and following is a code extract from my .emacs
based on some of Richard's and Nick's codes:

--8<---------------cut here---------------start------------->8---
;; and from RichardRiley's entry: http://www.emacswiki.org/emacs/OrgMode-OSD
;; and from Nick Dokos: http://article.gmane.org/gmane.emacs.orgmode/5271
(require 'appt)
(defun rgr/xml-escape (s)
  (setq s (replace-regexp-in-string "'" "&apos;" 
  (replace-regexp-in-string "\"" "&quot;"
  (replace-regexp-in-string "&" "&amp;" 
  (replace-regexp-in-string "<" "&lt;"
  (replace-regexp-in-string ">" "&gt;" s)))))))

(when window-system
  (defun rgr/osd-display (id msg &optional delay vattrib hattrib font) 
    "Display a message msg using OSD. Currently requires gnome-osd-client"
    (unless vattrib (setq vattrib "top"))
    (unless hattrib (setq hattrib "right"))
    (unless delay (setq delay 5000))
    (unless font (setq font "Arial 12"))
    (save-window-excursion
      (shell-command
       (format
        "gnome-osd-client -f \"<message id='%s' osd_fake_translucent_bg='on' 
osd_font='%s' animations='on' hide_timeout='%d' osd_vposition='%s' 
osd_halignment='%s'>%s</message>\""    
        id
        font
        delay
        vattrib
        hattrib
        (rgr/xml-escape msg)
        ))))
  (defun esf/notification-display (msg min-to-app new-time)
    (save-window-excursion
      (shell-command
       (format "notify-send -t 0 -i /home/ucecesf/s/share/emacs-icon.xpm 
'Agenda' \"In %s minutes:\n%s\"" min-to-app msg))))
)
(when window-system

  (setq appt-display-format 'window)
  
  (defun org-osd-display (min-to-app new-time msg)
    ; (rgr/osd-display msg msg -1 "center" "left" "Deja Vu Sans 20")
    (esf/notification-display msg min-to-app new-time)
    ; (message (format "executing notify-send %s minutes with message %s" 
min-to-app msg))
    )
  
  (setq appt-disp-window-function (function org-osd-display))
  
  ;; Run once, activate and schedule refresh
  (run-at-time nil 3600 'org-agenda-to-appt)
  (appt-activate t))

(setq appt-time-msg-list nil)
(org-agenda-to-appt)

(defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
  "Pressing `r' on the agenda will also add appointments."
  (progn 
    (setq appt-time-msg-list nil)
    (org-agenda-to-appt)))

(ad-activate 'org-agenda-redo)
--8<---------------cut here---------------end--------------->8---

This code uses the notification system built-in to Gnome/Kde/et
al. and pops up a little window.  Of course, this assumes you are
using X windows.  If you're using MS, I don't have anything to help
you unfortunately.

eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]