emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: Alarms in orgmode


From: Erwin Panen
Subject: [Orgmode] Re: Alarms in orgmode
Date: Fri, 06 Nov 2009 18:18:10 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hi Sébastien,

Un grand merci!
Big thank you - I'll try this out.

Erwin

Sébastien Vauban wrote:
Hi Erwin,

Erwin Panen wrote:
I was looking to set an audible alarm or at least display a message of some
kind. Google brought me no results, apart from capabilities that are within
Emacs itself, namely the diary & appointments.
http://www.gnu.org/software/emacs/manual/html_node/emacs/Appointments.html

Can anyone point me to how to do this, if possible at all.
(I'm on windows environment, but interested in Linux too.)

The following works for me (yes, I know, I should clean a bit) under Ubuntu at
least.

--8<---------------cut here---------------start------------->8---
    (require 'org-agenda)

    ;; Insinuate appt
    (require 'appt)
    (setq appt-time-msg-list nil)
    (org-agenda-to-appt)
    ;; When use 'r' (rebuild agenda) reload appt
    (add-hook 'org-agenda-mode-hook (lambda ()
                                      (setq appt-time-msg-list nil)
                                      (org-agenda-to-appt)))
    (setq appt-audible t)
    (setq appt-display-format 'echo)

    ;; turn appointment checking on
    (appt-activate 1)

    ;; time in minutes before an appointment that the warning begins
    (setq appt-message-warning-time 15)  ; 12

    ;; number of minutes to wait between checking the appointment list
    (setq appt-display-interval 5)  ; 3

    ;; update appt each time agenda opened
    (add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt)

    (when window-system
      (setq appt-display-format 'window)

      ;; FIXME Check `notify-send' (in `libnotify-bin' Ubuntu package) is 
installed
      (defun rgr/org-display (min-to-app new-time msg)
        (shell-command
         (concat "notify-send "
                 "-i /usr/share/icons/gnome/32x32/status/appointment-soon.png "
                 "'Appointment' "
                 "'" msg "'")))
      ;; TODO For Windows users: use todochicku.el and the snarl notifier

      (setq appt-disp-window-function (function rgr/org-display)))
--8<---------------cut here---------------end--------------->8---

Take what's of use for you from the above.

Best regards,
  Seb






reply via email to

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