xwem-devel
[Top] [All Lists]

code snippet: worklog-osd

From: Richard Klinda <ignotus@xxxxxxxxxxx>
Subject: code snippet: worklog-osd
Date: Thu, 09 Dec 2004 14:46:39 +0100
Organization: Oh, I get it!! ``The BEACH goes on,'' huh, SONNY??
Sender: ignotus@xxxxxxxxxxx
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux)
Hello,

With XWEM-osd it's very easy to pack the tray with lots of "useful"
information, here is such a little snippet, it puts the current worklog
project's name into a dockapp.  If you still have some empty space
in there, IMHO it's a good way to use it! :)

,----
| (defvar ign-worklog-osd nil)
|
| (defun ign-worklog-osd-update ()
|   (when ign-worklog-osd
|     (let ((color (or (plist-get (cadr (xwem-worklog-lookup-description
|                                        (xwem-worklog-task-name
|                                         (xwem-worklog-current-task)))) :color)
|                      ;; color when it is not available?
|                      "white"))
|           (project (xwem-worklog-task-name (xwem-worklog-current-task))))
|       (xwem-osd-set-color ign-worklog-osd color)
|       (xwem-osd-text ign-worklog-osd project))))
|
| (add-hook 'xwem-worklog-task-start-hook 'ign-worklog-osd-update)
`----

I start it from XWEM-AFTER-INIT-HOOK this way:

,----
|               (setq ign-worklog-osd (xwem-osd-create-dock (xwem-dpy) 80 16))
|               (when ign-worklog-osd
|                 (xwem-osd-set-font
|                  ign-worklog-osd
|                  "-xos4-terminus-bold-r-normal-*-*-160-*-*-c-*-iso8859-2"))
`----

-- 
Richard Klinda  \/
                /\  Show me your init.el and I'll you tell who you are.

<Prev in Thread] Current Thread [Next in Thread>
  • code snippet: worklog-osd, Richard Klinda <=