From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Idea for agenda notifications Date: Mon, 27 Apr 2009 18:27:53 +0100 Message-ID: <878wlmgg6e.fsf@eeepc.chemeng.ucl.ac.uk> References: <1e5bcefd0904241002p7ad213acg8a37853b4bedddfe@mail.gmail.com> <87bpqmt1ij.fsf@gollum.intra.norang.ca> <1e5bcefd0904241028h40057611j7a29925226555117@mail.gmail.com> <1e5bcefd0904241035i6d3422a1hf0f1546e27986640@mail.gmail.com> <87ocumrl5n.fsf@gollum.intra.norang.ca> <20090424195452.GS21189@thinkpad.adamsinfoserv.com> <1e5bcefd0904241637o37471c44n2bf1e4f769fe600d@mail.gmail.com> 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 1LyVVv-0007o9-HK for emacs-orgmode@gnu.org; Mon, 27 Apr 2009 14:25:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LyVVr-0007fV-OC for emacs-orgmode@gnu.org; Mon, 27 Apr 2009 14:25:11 -0400 Received: from [199.232.76.173] (port=41435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LyVVr-0007f6-KC for emacs-orgmode@gnu.org; Mon, 27 Apr 2009 14:25:07 -0400 Received: from main.gmane.org ([80.91.229.2]:53570 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LyVVq-0003dD-SI for emacs-orgmode@gnu.org; Mon, 27 Apr 2009 14:25:07 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1LyVVm-00074B-Hx for emacs-orgmode@gnu.org; Mon, 27 Apr 2009 18:25:02 +0000 Received: from 79-74-1-221.dynamic.dsl.as9105.com ([79.74.1.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Apr 2009 18:25:02 +0000 Received: from e.fraga by 79-74-1-221.dynamic.dsl.as9105.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Apr 2009 18:25:02 +0000 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: emacs-orgmode@gnu.org Marcelo de Moraes Serpa writes: > Awesome! This idea could be extended to add other kind of events, like > send emails, SMS, play some audio file, whatever (turn org-mode in a > kind of PIM server too.. hmm, lots of cool ideas come to my mind). I > still prefer using the gnome-notifier but it shouldn't be hard to > adapt it for that. > > Well -- the first thing I need to do though is to master elisp :) I use a similar mechanism based on osd (on screen display) which doesn't pop up windows but simply writes text directly onto the display (over top of anything and everything). Much less intrusive than a pop-up window (IMO... YMMV) and is completely window manager agnostic (perfect for my Asus running X with ratpoison, for instance). The original code comes from Richard Riley and I believe the code I have was modified by Nick Dokos? In any case, the code is below. My elisp is not good enough to determine which bits are absolutely necessary, mind you... On Debian systems, you would need to install the gnome-osd package. Hope this helps! ----------------------------------------------- cut here -------------- (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) ))))) (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" "Verdana 20")) (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)