emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Alarms in orgmode
@ 2009-11-05 14:46 Erwin Panen
  2009-11-06 13:47 ` Sébastien Vauban
  0 siblings, 1 reply; 4+ messages in thread
From: Erwin Panen @ 2009-11-05 14:46 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

Hi everyone,

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.)

Thanks for your help!

Erwin

[-- Attachment #2: www.gnu.org/software/emacs/manual/html_node/emacs/Appointments.html --]
[-- Type: text/html, Size: 6106 bytes --]

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alarms in orgmode
  2009-11-05 14:46 Alarms in orgmode Erwin Panen
@ 2009-11-06 13:47 ` Sébastien Vauban
  2009-11-06 17:18   ` Erwin Panen
  2013-06-12 13:03   ` Rene
  0 siblings, 2 replies; 4+ messages in thread
From: Sébastien Vauban @ 2009-11-06 13:47 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alarms in orgmode
  2009-11-06 13:47 ` Sébastien Vauban
@ 2009-11-06 17:18   ` Erwin Panen
  2013-06-12 13:03   ` Rene
  1 sibling, 0 replies; 4+ messages in thread
From: Erwin Panen @ 2009-11-06 17:18 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: public-emacs-orgmode-mXXj517/zsQ

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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alarms in orgmode
  2009-11-06 13:47 ` Sébastien Vauban
  2009-11-06 17:18   ` Erwin Panen
@ 2013-06-12 13:03   ` Rene
  1 sibling, 0 replies; 4+ messages in thread
From: Rene @ 2013-06-12 13:03 UTC (permalink / raw)
  To: emacs-orgmode


Sébastien Vauban <wxhgmqzgwmuf@...> writes:

> --8<---------------cut here---------------start------------->8---
>       (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---


If two (or more) appointments happen to start at the same time then
appt-disp-window-function leads to the following error: “Argtype error in
‘appt-disp-window-function’ - update it for multiple appts?”

A more suited piece of code would be:

(setq appt-disp-window-function
      (lambda  (min-to-app new-time appt-msg) ; these args could be lists
        (or (listp min-to-app)
            (setq appt-msg (list appt-msg)))
        (dotimes (i (length appt-msg))
          (shell-command
            (concat "notify-send "
              "-i /usr/share/icons/gnome/32x32/status/appointment-soon.png "
                    "-t 1000 "
                    "'Appointment' "
                    "'" (nth i appt-msg) "'")))))

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-12 13:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-05 14:46 Alarms in orgmode Erwin Panen
2009-11-06 13:47 ` Sébastien Vauban
2009-11-06 17:18   ` Erwin Panen
2013-06-12 13:03   ` Rene

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).