[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XWEM]: Re: Adding things to xwem-tray
From: |
Steve Youngs |
Subject: |
[XWEM]: Re: Adding things to xwem-tray |
Date: |
Fri, 09 Apr 2004 17:02:16 +1000 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) XEmacs/21.4 (Security Through Obscurity, linux) |
* Zajcev Evgeny <address@hidden> writes:
> Steve Youngs <address@hidden> writes:
>> I've been looking at my screen wondering "what's missing?"... The date!
[...]
> I think date support can be added to xwem-time, customizable variable
> like `display-time-day-and-date'.
Nope, that doesn't work. :-(
But this does...
;; Display the date in the bottom right of screen using OSD
(require 'xwem-osd)
(copy-face 'default 'sy-osd-face)
(set-face-foreground 'sy-osd-face "cyan")
(defun sy-show-date-osd ()
(let* ((fromleft 830)
(fromtop 740)
(face `sy-osd-face)
(text (format-time-string "%a, %b%e")))
(setq sy-osd (xwem-osd-create (xwem-dpy) fromleft fromtop 400 200))
(xwem-osd-set-color sy-osd (face-foreground-name face))
(xwem-osd-set-font sy-osd (face-font-name face))
(xwem-osd-text sy-osd text)
(xwem-osd-show sy-osd)))
(defun sy-hide-date-osd ()
(xwem-osd-hide sy-osd))
(defun sy-update-osd-date-maybe ()
(let* ((now (decode-time))
(cur-hour (nth 2 now))
(cur-min (nth 1 now))
(cur-comp-time (+ (* cur-hour 60) cur-min)))
(when (= 0 cur-comp-time)
(sy-hide-date-osd)
(sy-show-date-osd))))
(add-hook 'xwem-after-init-hook 'sy-show-date-osd)
(start-itimer "sy-osd-date-itimer"
'sy-update-osd-date-maybe
60 60)
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| Ashes to ashes, dust to dust. |
| The proof of the pudding, is under the crust. |
|------------------------------<address@hidden>---|
pgpCNL7lxZIzj.pgp
Description: PGP signature