Make the notifier able to display the date.
authorArthur Gleckler <edu/mit/csail/zurich/arthur>
Sun, 8 Mar 1992 16:32:05 +0000 (16:32 +0000)
committerArthur Gleckler <edu/mit/csail/zurich/arthur>
Sun, 8 Mar 1992 16:32:05 +0000 (16:32 +0000)
v7/src/edwin/notify.scm

index 3d7837a11eea9a7b5d0566598eaf7d0527dc7641..e6d6eb042feadbf71b5b1af42e2c1f177eb41fdb 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/notify.scm,v 1.6 1992/02/19 00:11:02 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/notify.scm,v 1.7 1992/03/08 16:32:05 arthur Exp $
 ;;;
 ;;;    Copyright (c) 1992 Massachusetts Institute of Technology
 ;;;
                     (write-to-string minute)
                     (if (< hour 12) "am" "pm")))))
 
+(define-variable notify-show-date
+  "If true, the notifier displays the current date."
+  false
+  boolean?)
+
+(define (notifier:date)
+  (let ((time (get-decoded-time)))
+    (string-append (vector-ref
+                   '#("Mon " "Tue " "Wed " "Thu " "Fri " "Sat " "Sun ")
+                   (decoded-time/day-of-week time))
+                  (write-to-string (decoded-time/day time))
+                  (vector-ref
+                   '#(" Jan" " Feb" " Mar" " Apr" " May" " Jun"
+                     " Jul" " Aug" " Sep" " Oct" " Nov" " Dec")
+                   (decoded-time/month time)))))
+
 (define-variable notify-show-load
   "If true, the notifier displays the load average."
   false
@@ -122,6 +138,7 @@ Ignored if notify-show-mail is false."
 
 (define notifier-elements
   (list (cons (ref-variable-object notify-show-time) notifier:time)
+       (cons (ref-variable-object notify-show-date) notifier:date)
        (cons (ref-variable-object notify-show-load) notifier:load-average)))
 \f
 (define-command run-notifier