emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Riley <rileyrgdev@googlemail.com>
To: Eric S Fraga <e.fraga@ucl.ac.uk>
Cc: Bastien <bastienguerry@googlemail.com>,
	emacs-orgmode@gnu.org, henry atting <nsmp_01@online.de>
Subject: Re: tea-time?
Date: Thu, 30 Jul 2009 14:34:42 +0200	[thread overview]
Message-ID: <4a719363.095c5e0a.0546.ffffabeb@mx.google.com> (raw)
In-Reply-To: <87y6q6qw0a.wl%ucecesf@ucl.ac.uk> (Eric S. Fraga's message of "Thu, 30 Jul 2009 11:56:53 +0100")


Eric S Fraga <ucecesf@ucl.ac.uk> writes:

> At Wed, 29 Jul 2009 18:29:19 -0400,
> Nick Dokos wrote:
>> 
>> Samuel Wales <samologist@gmail.com> wrote:
>> 
>> > Hi Bastien,
>> > 
>> > I did not realize that appt could not be used.
>> > 
>> > On 2009-07-29, Bastien <bastienguerry@googlemail.com> 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:
>
>
>
> ;; 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)


On that subject I dont use that stuff anymore, but use this on gnome for
erc notifications directed at me (so if erc buffers are hidden I get a
pop up when someone directs at msg directly at me). Its a lot nicer than
OSD imo and the code (primarily from Andy Stewart) could easily be adjusted
for your Org needs too:

,----
| (defvar erc-nick-notify-last '(0 0 0))
| (defvar erc-nick-notify-delay '(0 5 0))
| (defvar erc-nick-notify-cmd "notify-send")
| (defvar erc-nick-notify-icon "~/images/mail.png")
| (defvar erc-nick-notify-timeout 10000)
| (defvar erc-nick-notify-urgency "low")
| (defvar erc-nick-notify-category "im.received")
| 
| (add-hook 'erc-text-matched-hook
|               (lambda (match-type nickuserhost message)
|                 (cond
|                   ((eq match-type 'current-nick)
| 		      (if (eq (string-match (concat (erc-current-nick) ":") message) 0) (shell-command (concat erc-nick-notify-cmd
| 					     " -i " erc-nick-notify-icon
| 					     " -t " (int-to-string
| 						     erc-nick-notify-timeout)
| 					     " -c " erc-nick-notify-category
| 					     " '" message "'")))))))
`----

It might be of interest to someone.

  reply	other threads:[~2009-07-30 12:34 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-11 11:58 tea-time? henry atting
2009-06-11 12:34 ` tea-time? Sebastian Rose
2009-07-17  3:56   ` tea-time? Samuel Wales
2009-07-17  7:24     ` tea-time? Bastien
2009-07-25 19:49       ` tea-time? Samuel Wales
2009-07-25 22:20         ` tea-time? Bastien
2009-07-26  0:14           ` tea-time? Samuel Wales
2009-07-26 19:04             ` tea-time? Bastien
2009-07-29 17:30               ` tea-time? Samuel Wales
2009-07-29 17:31                 ` tea-time? Samuel Wales
2009-07-29 17:41                 ` tea-time? Bastien
2009-07-29 17:54                   ` tea-time? Samuel Wales
2009-07-29 18:41                     ` tea-time? Bastien
2009-07-29 19:06                 ` tea-time? Bastien
2009-07-29 21:45                   ` tea-time? Samuel Wales
2009-07-29 22:29                     ` tea-time? Nick Dokos
2009-07-30  5:18                       ` tea-time? Bastien
2009-07-30 10:56                       ` tea-time? Eric S Fraga
2009-07-30 12:34                         ` Richard Riley [this message]
2009-07-30  5:48                     ` tea-time? Bastien
     [not found]                     ` <samologist@gmail.com>
2012-08-28  1:11                       ` How to make kill-sexp work as in the rest of Emacs? Samuel Wales
2012-08-28  3:43                         ` Nick Dokos
2012-08-28  4:08                           ` Samuel Wales
2012-08-28  5:30                             ` Nick Dokos
2012-08-28  5:33                               ` Samuel Wales
2012-08-30  5:04                               ` Bastien
2009-07-17 12:46     ` tea-time? Bernt Hansen
  -- strict thread matches above, loose matches on Subject: below --
2010-11-11 22:05 HTML export and blogging to blogger.com Samuel Wales
2010-11-11 22:50 ` Nick Dokos
2010-11-11 23:06   ` Samuel Wales
2010-11-12  3:45     ` Nick Dokos
2010-11-11 23:07 ` John Hendy
2010-11-11 23:18   ` Samuel Wales
2010-11-11 23:40     ` John Hendy
2010-11-12  2:25       ` Samuel Wales
2010-11-12 10:47         ` Eric S Fraga
2010-11-12 19:32           ` Samuel Wales
2010-11-14  1:25 ` Samuel Wales
2010-11-14  2:26   ` John Hendy
2010-11-14  2:54     ` Samuel Wales
2010-11-16  3:01   ` Samuel Wales
2010-11-16  9:50     ` Giovanni Ridolfi
2010-11-16 18:26       ` Samuel Wales
2010-11-16 23:17         ` Samuel Wales
2010-11-16 23:32           ` John Hendy
2010-11-17  0:13             ` Samuel Wales
2010-11-17  0:17               ` Samuel Wales
2010-11-17  4:34                 ` John Hendy
2010-11-17  4:45                   ` John Hendy
2010-11-17  9:09                     ` Eric S Fraga
2010-11-17 16:36                       ` John Hendy
2010-11-17 16:46                         ` Eric S Fraga
2010-11-24  1:59                       ` Samuel Wales
2010-11-24  9:09                         ` Eric S Fraga
2010-11-24  2:03                   ` Samuel Wales
2010-11-17 11:47         ` Christian Moe
2010-11-17 12:28           ` Add a hook with #+BIND? Christian Moe
2010-11-18  5:44           ` Re: HTML export and blogging to blogger.com John Hendy
2010-11-17  3:46   ` Nick Dokos
2010-11-17  4:18     ` John Hendy
2010-11-17  5:17       ` Nick Dokos
2010-11-17  5:52     ` Samuel Wales
2010-11-17  6:09       ` Nick Dokos
2010-11-24  2:00         ` Samuel Wales
2010-11-17 10:17       ` Tim Burt
2010-11-24  1:58         ` Samuel Wales
2012-05-29 17:24 Annoying behavior of RET after a timestamp Nick Dokos
2012-05-29 17:46 ` Nick Dokos
2012-05-29 17:54   ` Samuel Wales
2012-05-29 18:43     ` Nick Dokos
2012-05-29 18:57       ` Samuel Wales
2012-05-29 19:04         ` suvayu ali
2012-05-29 19:15         ` Nick Dokos
2012-05-29 19:21           ` Nick Dokos
2012-05-29 19:26             ` Nick Dokos
2012-05-29 20:05               ` Samuel Wales
2012-05-31 12:43               ` Matt Lundin
2012-06-01 13:57                 ` Bastien
2012-06-01 13:55 ` Bastien
2012-06-01 15:41   ` Nick Dokos

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://www.orgmode.org/

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

  git send-email \
    --in-reply-to=4a719363.095c5e0a.0546.ffffabeb@mx.google.com \
    --to=rileyrgdev@googlemail.com \
    --cc=bastienguerry@googlemail.com \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=nsmp_01@online.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).