From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: OSD alerts for appointment reminders (+ erc hook to use OSD) Date: Fri, 26 Sep 2008 05:18:06 +0200 Message-ID: References: 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 1Kj3q0-0001ri-D3 for emacs-orgmode@gnu.org; Thu, 25 Sep 2008 23:17:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kj3py-0001pj-9y for emacs-orgmode@gnu.org; Thu, 25 Sep 2008 23:17:47 -0400 Received: from [199.232.76.173] (port=40421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kj3py-0001pZ-3l for emacs-orgmode@gnu.org; Thu, 25 Sep 2008 23:17:46 -0400 Received: from main.gmane.org ([80.91.229.2]:42714 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 1Kj3px-00080l-WB for emacs-orgmode@gnu.org; Thu, 25 Sep 2008 23:17:46 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Kj3pt-0007J0-Tx for emacs-orgmode@gnu.org; Fri, 26 Sep 2008 03:17:41 +0000 Received: from f054124106.adsl.alicedsl.de ([78.54.124.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 26 Sep 2008 03:17:41 +0000 Received: from rileyrgdev by f054124106.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 26 Sep 2008 03:17:41 +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 Richard Riley writes: > I thought some of you linux users might like this - use gnome-osd-client > to put an on screen reminder of your looming appointments. I include a > screenshot link below. I'm sure the code can be improved as I'm not much > of an elisp programmer. I have also included an erc hook to use OSD to > display messages in your subscribed irc channels directed at you. Hope > you like it. I dont know if the gnome-osd stuff will work on kde, but > try it and see. > > http://www.imagebucket.in/images/layopataa1r203lmuwp3.png > > > org stuff: > > ,---- > | ; Update appt each time agenda opened. > | (add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt) > | > | (setq appt-display-format 'window) > | > | (defun org-osd-display (min-to-app new-time msg) > | (osd-display msg msg -1 "center" "center" "Verdana 20") > | ) > | > | (setq appt-disp-window-function (function org-osd-display)) > | > | ;; see my-osd for plugins > | > | (require 'diary-lib) > | (add-hook 'diary-display-hook 'fancy-diary-display) > | > | ;; Run once, activate and schedule refresh > | (run-at-time nil 3600 'org-agenda-to-appt) > | (appt-activate t) > `---- > > osd stuff: > > ,---- > | (defun osd-display (id msg &optional delay vattrib hattrib font) > | > | "Display a message with an id of ID for delay seconds with message msg" > | > | (unless vattrib (setq vattrib "top")) > | (unless hattrib (setq hattrib "right")) > | (unless delay (setq delay 5000)) > | (unless font (setq font "Serif Bold Italic 32")) > | > | (save-window-excursion > | (shell-command > | (format > | "gnome-osd-client -f \"%s\"" > | id > | font > | delay > | vattrib > | hattrib > | msg) > | nil nil) > | )) > | > | ;(osd-display "i2" "and OSD..." 500) > | ;(osd-display "id" "Welcome to Emacs" 1000 "top" "center" "Verdana 20") > | > `---- > > Finally the erc hook stuff: > > ,---- > | (defun erc-notify-osd (matched-type nick msg) > | (when (string= matched-type "current-nick") > | (message msg) > | (string-match ".*:\\(.*\\)$" msg) > | (setq msg (match-string 1 msg)) > | (osd-display (concat "erc-msg : " (erc-extract-nick nick)) (concat (erc-extract-nick nick) " : " msg) 10000 "bottom" "center" "Verdana 23") > | )) > | > | (add-hook 'erc-text-matched-hook 'erc-notify-osd) > `---- I forgot to mention you need to enable the erc module "match" e.g my erc-modules is: (setq erc-modules (quote (autoaway autojoin button completion match menu move-to-prompt noncommands readonly scrolltobottom services smiley stamp spelling truncate highlight-nicknames netsplit fill readonly noncommands irccontrols move-to-prompt)))