From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Piotr Zielinski" Subject: Re: automatic reminders in Emacs as pop ups [was: Re: Survey results ] Date: Sun, 27 Jan 2008 22:42:26 +0000 Message-ID: <3c12eb8d0801271442s4cb090deu555fd6405ebdd291@mail.gmail.com> References: <13222.1201471868@gamaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJGCt-0002l2-DW for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:42:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJGCr-0002kq-Dp for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:42:30 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJGCr-0002kn-Aw for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:42:29 -0500 Received: from wa-out-1112.google.com ([209.85.146.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJGCq-0005uW-Lp for emacs-orgmode@gnu.org; Sun, 27 Jan 2008 17:42:29 -0500 Received: by wa-out-1112.google.com with SMTP id k34so3389314wah.10 for ; Sun, 27 Jan 2008 14:42:26 -0800 (PST) In-Reply-To: <13222.1201471868@gamaville.dokosmarshall.org> Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: org-mode mailing list , Carsten Dominik Also, debian/ubuntu package libnotify-bin contains a command-line utility "notify-send" that you can use to display non-modal user notifications, in the same way as popup.py. Piotr On Jan 27, 2008 10:11 PM, Nick Dokos wrote: > One answer to question 5 on the survey was another question: automatic > reminders in Emacs as pop ups? > > Here is how I do it, using very little machinery. As part of org-mode > initialization, I add appointments from the diary to the agenda at > startup and I also make org-agenda-redo rescan the appt list: > > ----------------------------------- > (require 'appt) > (setq org-agenda-include-diary 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) > ----------------------------------- > > I enable appt reminders, set the format to 'window and provide > a display function that calls a python program to do the popup: > > ----------------------------------- > (progn > (appt-activate 1) > (setq appt-display-format 'window) > (setq appt-disp-window-function (function my-appt-disp-window)) > (defun my-appt-disp-window (min-to-app new-time msg) > (call-process "/home/nick/bin/popup.py" nil 0 nil min-to-app msg new-time))) > ----------------------------------- > > Finally, the popup.py program is trivial: > > ----------------------------------- > #!/usr/bin/env python > > """ Simple dialog popup example similar to the GTK+ Tutorials one """ > > import gtk > import sys > > mins = sys.argv[1] > text = ' '.join(sys.argv[2:]) > dialog = gtk.MessageDialog(None, > gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, > gtk.MESSAGE_INFO, gtk.BUTTONS_OK, > "Appt in %s mins: %s" % (mins, text)) > dialog.run() > dialog.destroy() > ----------------------------------- > > HTH, > Nick > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >