From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: tea-time? Date: Thu, 30 Jul 2009 14:34:42 +0200 Message-ID: <4a719363.095c5e0a.0546.ffffabeb@mx.google.com> References: <871vpr6ky5.fsf@online.de> <87ab4f6ja9.fsf@kassiopeya.MSHEIMNETZ> <20524da70907162056h22637e0byee429770336b73de@mail.gmail.com> <8763drn567.fsf@bzg.ath.cx> <20524da70907251249q19f6775cob0d9bc66ed0a5d71@mail.gmail.com> <87ljmc9zn8.fsf@bzg.ath.cx> <20524da70907251714u6df5b9e4x498269578911ab4@mail.gmail.com> <87d47n9sfb.fsf@bzg.ath.cx> <20524da70907291030q11737210lab5966b66a01a7a@mail.gmail.com> <87eirzcnr0.fsf@bzg.ath.cx> <20524da70907291445p49c13fd9rcf77ddce4aa1e7b7@mail.gmail.com> <8979.1248906559@alphaville.usa.hp.com> <87y6q6qw0a.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWUqU-00048z-2n for emacs-orgmode@gnu.org; Thu, 30 Jul 2009 08:34:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWUqP-00044O-1p for emacs-orgmode@gnu.org; Thu, 30 Jul 2009 08:34:53 -0400 Received: from [199.232.76.173] (port=33213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWUqO-00044A-Qq for emacs-orgmode@gnu.org; Thu, 30 Jul 2009 08:34:48 -0400 Received: from mx20.gnu.org ([199.232.41.8]:34364) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWUqO-0005Eb-B0 for emacs-orgmode@gnu.org; Thu, 30 Jul 2009 08:34:48 -0400 Received: from mail-fx0-f205.google.com ([209.85.220.205]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWUqM-00016Y-NT for emacs-orgmode@gnu.org; Thu, 30 Jul 2009 08:34:46 -0400 Received: by mail-fx0-f205.google.com with SMTP id 1so586445fxm.31 for ; Thu, 30 Jul 2009 05:34:45 -0700 (PDT) In-Reply-To: <87y6q6qw0a.wl%ucecesf@ucl.ac.uk> (Eric S. Fraga's message of "Thu, 30 Jul 2009 11:56:53 +0100") 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: Eric S Fraga Cc: Bastien , emacs-orgmode@gnu.org, henry atting Eric S Fraga writes: > At Wed, 29 Jul 2009 18:29:19 -0400, > Nick Dokos wrote: >> >> Samuel Wales wrote: >> >> > Hi Bastien, >> > >> > I did not realize that appt could not be used. >> > >> > On 2009-07-29, Bastien 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 "'" "'" > (replace-regexp-in-string "\"" """ > (replace-regexp-in-string "&" "&" > (replace-regexp-in-string "<" "<" > (replace-regexp-in-string ">" ">" 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 \"%s\"" > 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.