Update.
authorFrancois Fleuret <francois@fleuret.org>
Wed, 30 Dec 2015 17:09:22 +0000 (18:09 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 30 Dec 2015 17:09:22 +0000 (18:09 +0100)
emacs.el

index bd8ada2..cad17c1 100644 (file)
--- a/emacs.el
+++ b/emacs.el
@@ -340,6 +340,7 @@ load-warning buffer in case of failure."
                                                 (flyspell-mode))))
 
 (add-hook 'c++-mode-hook 'flyspell-prog-mode)
+(add-hook 'lua-mode-hook 'flyspell-prog-mode)
 (add-hook 'log-edit-mode-hook 'flyspell-mode)
 
 ;; I am a power-user
@@ -452,6 +453,7 @@ load-warning buffer in case of failure."
      (fringe :background "gray80")
      (ff/date-info-face :foreground "white")
      (ff/battery-info-face :foreground "black")
+     (ff/battery-info-alarm-face :foreground "red")
      ;; (ff/mail-alarm-face :foreground "white" :background "red2")
      ;; (alarm-vc-face :foreground "black" :background "yellow" :weight 'normal)
      (gui-button-face :background "green" :foreground "black")
@@ -505,6 +507,7 @@ load-warning buffer in case of failure."
      (region :background "white" :foreground "black")
      (ff/date-info-face :foreground "white" :weight 'bold)
      (ff/battery-info-face :foreground "black")
+     (ff/battery-info-alarm-face :foreground "red")
      ;; (ff/mail-alarm-face :foreground "red" :weight 'bold)
      (selector/selection :background "yellow")
      (gui-button-face :background "green" :foreground "white")
@@ -878,8 +881,23 @@ printer."
              ;; (`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)))
+
+             (`charging
+              (let ((p (ff/battery-percent)))
+                (if (> p 10)
+                    (propertize (format "↑%d%%" p) 'face 'ff/battery-info-face)
+                  (propertize (format "↑%d%%" p) 'face 'ff/battery-info-alarm-face))
+                )
+              )
+
+             (`discharging
+              (let ((p (ff/battery-percent)))
+                (if (> p 10)
+                    (propertize (format "↓%d%%" p) 'face 'ff/battery-info-face)
+                  (propertize (format "↓%d%%" p) 'face 'ff/battery-info-alarm-face))
+                )
+              )
+
              ;; (`unknown "✱")
              (`unknown "F")
              (_ "?"))
@@ -948,9 +966,11 @@ printer."
                                  '((ff/temp-info-string)))
 
                              ,@(when (ff/battery-info-string)
-                                 '((propertize
-                                    (ff/battery-info-string)
-                                    'face 'ff/battery-info-face)))
+                                 '((ff/battery-info-string)))
+
+                                 ;; '((propertize
+                                    ;; (ff/battery-info-string)
+                                    ;; 'face 'ff/battery-info-face)))
 
                              " "