From: Richard Riley <rileyrgdev@googlemail.com>
To: org-mode <emacs-orgmode@gnu.org>
Subject: OSD alerts for appointment reminders (+ erc hook to use OSD)
Date: Thu, 25 Sep 2008 02:43:56 +0200 [thread overview]
Message-ID: <iqk5d19hrn.fsf@googlemail.com> (raw)
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)
|
| (require 'my-osd)
|
| (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 \"<message id='%s' osd_fake_translucent_bg='off' osd_font='%s' animations='on' hide_timeout='%d' osd_vposition='%s' osd_halignment='%s'>%s</message>\""
| 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)
`----
next reply other threads:[~2008-09-25 0:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-25 0:43 Richard Riley [this message]
2008-09-25 6:22 ` OSD alerts for appointment reminders (+ erc hook to use OSD) Paul R
2008-09-25 13:10 ` OSD alerts for appointment reminders (+ erc hook to useOSD) Chris Randle
2008-09-26 3:18 ` OSD alerts for appointment reminders (+ erc hook to use OSD) Richard Riley
2008-09-26 19:10 ` Cezar Halmagean
[not found] ` <87wsgyyb8j.fsf@cezar@mixandgo.com>
2008-09-27 15:45 ` Richard Riley
2008-09-29 18:38 ` Cezar Halmagean
[not found] ` <87hc7yol03.fsf@cezar@mixandgo.com>
2008-09-29 18:44 ` Richard Riley
2008-09-29 18:48 ` Cezar Halmagean
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=iqk5d19hrn.fsf@googlemail.com \
--to=rileyrgdev@googlemail.com \
--cc=emacs-orgmode@gnu.org \
/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).