emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/minibar f228469970 06/17: Use char-displayable-p instead o


From: ELPA Syncer
Subject: [nongnu] elpa/minibar f228469970 06/17: Use char-displayable-p instead of display-graphic-p
Date: Sun, 27 Nov 2022 16:01:37 -0500 (EST)

branch: elpa/minibar
commit f228469970965d50c6f6a12f1015fa4a4f319fa3
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Use char-displayable-p instead of display-graphic-p
---
 minibar.el | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/minibar.el b/minibar.el
index 26cf9d354b..05cc9b69a0 100644
--- a/minibar.el
+++ b/minibar.el
@@ -422,7 +422,13 @@ it was recorded.")
         (format
          "%3i%%%s"
          (minibar--module-cpu-calculate-load "cpu")
-         (if (display-graphic-p)
+         (if (and (char-displayable-p ?█)  ;; #x2588
+                  (char-displayable-p ?▇)  ;; #x2587
+                  (char-displayable-p ?▆)  ;; #x2586
+                  (char-displayable-p ?▅)  ;; #x2585
+                  (char-displayable-p ?▄)  ;; #x2584
+                  (char-displayable-p ?▃)  ;; #x2583
+                  (char-displayable-p ?▂)) ;; #x2582
              (concat
               " "
               (mapconcat
@@ -431,19 +437,19 @@ it was recorded.")
                               (format "cpu%i" i))))
                    (cond
                     ((>= load 87.5)
-                     (propertize (string #x2588) 'face 'bold))
+                     (propertize "█" 'face 'bold))
                     ((>= load 75)
-                     (propertize (string #x2587) 'face 'bold))
+                     (propertize "▇" 'face 'bold))
                     ((>= load 62.5)
-                     (propertize (string #x2586) 'face 'bold))
+                     (propertize "▆" 'face 'bold))
                     ((>= load 50)
-                     (propertize (string #x2585) 'face 'bold))
+                     (propertize "▅" 'face 'bold))
                     ((>= load 37.5)
-                     (propertize (string #x2584) 'face 'bold))
+                     (propertize "▄" 'face 'bold))
                     ((>= load 25)
-                     (propertize (string #x2583) 'face 'bold))
+                     (propertize "▃" 'face 'bold))
                     ((>= load 12.5)
-                     (propertize (string #x2582) 'face 'bold))
+                     (propertize "▂" 'face 'bold))
                     (t
                      (propertize
                       (string #x2581) 'face



reply via email to

[Prev in Thread] Current Thread [Next in Thread]