Org-mode mailing list
 help / color / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: automatic reminders in Emacs as pop ups [was: Re: Survey results ]
Date: Sun, 27 Jan 2008 17:11:08 -0500
Message-ID: <13222.1201471868@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Carsten Dominik <carsten.dominik@gmail.com> of "Sun, 27 Jan 2008 22:22:46 +0100." <CF32DFAB-6D2C-49E3-AE39-294DA28F704D@gmail.com>

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

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-27 21:22 Survey results Carsten Dominik
2008-01-27 22:11 ` Nick Dokos [this message]
2008-01-27 22:42   ` automatic reminders in Emacs as pop ups [was: Re: Survey results ] Piotr Zielinski
2008-01-27 23:05 ` Survey results Leo
2008-01-27 23:21   ` Bastien Guerry

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

  List information: https://orgmode.org

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

  git send-email \
    --in-reply-to=13222.1201471868@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@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

Org-mode mailing list

Archives are clonable:
	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git