Update.
authorFrancois Fleuret <francois@fleuret.org>
Mon, 30 Nov 2015 08:32:48 +0000 (09:32 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Mon, 30 Nov 2015 08:32:48 +0000 (09:32 +0100)
emacs.el

index 47b66f3..1b17d1b 100644 (file)
--- a/emacs.el
+++ b/emacs.el
@@ -867,40 +867,38 @@ printer."
     (error -1))
   )
 
-(defun ff/temp-and-battery-info-string () (interactive)
+(defun ff/temp-info-string () (interactive)
        (condition-case nil
-           (concat
-
-            ;; The temperature
-
-            (let ((temp (/
-                         (apply 'max (mapcar
-                                      (lambda (f) (string-to-number (ff/file-first-line f)))
-                                      ff/temperature-files))
-                         1000)))
-
-              (if (> temp 50)
-                  (let ((s (format "%dC " temp)))
-                    (if (> temp 70)
-                        (propertize s 'face 'font-lock-warning-face)
-                      s)
-                    )
-                )
-              )
-
-            ;; The battery
-
-             (pcase (ff/battery-state ff/battery-dirs)
-               ;; (`charging (format "c%d%%" (ff/battery-percent)))
-               ;; (`discharging (format "d%d%%" (ff/battery-percent)))
-               ;; (`unknown "f")
-               (`charging (format "↑%d%%" (ff/battery-percent)))
-               (`discharging (format "↓%d%%" (ff/battery-percent)))
-               (`unknown "✱")
-               (_ "?"))
+           ;; The temperature
+
+           (let ((temp (/
+                        (apply 'max (mapcar
+                                     (lambda (f) (string-to-number (ff/file-first-line f)))
+                                     ff/temperature-files))
+                        1000)))
+
+             (if (> temp 50)
+                 (let ((s (format "%dC " temp)))
+                   (if (> temp 70)
+                       (propertize s 'face 'font-lock-warning-face)
+                     s)
+                   )
+               )
+             )
 
-            )
+         (error nil))
+       )
 
+(defun ff/battery-info-string () (interactive)
+       (condition-case nil
+           (pcase (ff/battery-state ff/battery-dirs)
+             ;; (`charging (format "c%d%%" (ff/battery-percent)))
+             ;; (`discharging (format "d%d%%" (ff/battery-percent)))
+             ;; (`unknown "f")
+             (`charging (format "↑%d%%" (ff/battery-percent)))
+             (`discharging (format "↓%d%%" (ff/battery-percent)))
+             (`unknown "✱")
+             (_ "?"))
          (error nil))
        )
 
@@ -972,26 +970,31 @@ printer."
 
 (setq
 
- display-time-interval 15 ;; Check every 15s
+ display-time-interval 10 ;; Check every 10s
 
  display-time-string-forms `(
 
                              load " "
 
-                             (propertize
-                              (ff/temp-and-battery-info-string)
-                              'face 'ff/battery-info-face)
+                                  (ff/temp-info-string)
 
-                             (propertize
-                              (concat " <"
-                                      24-hours ":" minutes
-                                      " "
-                                      ;; dayname " "
-                                      monthname " " day
-                                      ">")
-                              'face 'ff/date-info-face)
+                                  (propertize
+                                   (ff/battery-info-string)
+                                   'face 'ff/battery-info-face)
 
-                             )
+                                  " "
+
+                                  (propertize
+                                   (concat ;;" ˌ"
+                                    24-hours ":" minutes
+                                    " "
+                                    ;; dayname " "
+                                    monthname " " day
+                                    ;;"ˌ"
+                                    )
+                                   'face 'ff/date-info-face)
+
+                                  )
 
  ;; display-time-format "%b %a %e %H:%M"
  ;; display-time-mail-face nil