[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/minibar 3913de72e0 15/17: Try to make all lines less than
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/minibar 3913de72e0 15/17: Try to make all lines less than 75 characters width |
Date: |
Sun, 27 Nov 2022 16:01:38 -0500 (EST) |
branch: elpa/minibar
commit 3913de72e06a57c3fc82edfb5253d46ef960bf80
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Try to make all lines less than 75 characters width
---
README.org | 14 +++++-----
minibar.el | 91 +++++++++++++++++++++++++++++++++++---------------------------
2 files changed, 59 insertions(+), 46 deletions(-)
diff --git a/README.org b/README.org
index ee7fba53e7..9bdbd549d2 100644
--- a/README.org
+++ b/README.org
@@ -1,9 +1,10 @@
#+title: Minibar - Modular status bar in minibuffer
-The echo area is unused most of the time. Sometimes this empty area so
-annoying that some people want to get rid of it. This package makes it
-useful by showing a status bar in it when it's unused. This is especially
-helpful when you use Emacs as your X window manager using EXWM.
+The echo area is unused most of the time. Sometimes this empty area
+so annoying that some people want to get rid of it. This package
+makes it useful by showing a status bar in it when it's unused. This
+is especially helpful when you use Emacs as your X window manager
+using EXWM.
* Installation
@@ -29,5 +30,6 @@ Download =minibar.el= and put it in your ~load-path~.
* Usage
Enable ~minibar-mode~ to display Minibar. You may want to put
-~(minibar-mode +1)~ in your init file. There are several user options you
-can customize, use ~customize-group~ to see and possibly customize them.
+~(minibar-mode +1)~ in your init file. There are several user options
+you can customize, use ~customize-group~ to discover and possibly
+customize them.
diff --git a/minibar.el b/minibar.el
index e8bb27e1c0..983b3ff58b 100644
--- a/minibar.el
+++ b/minibar.el
@@ -25,18 +25,18 @@
;;; Commentary:
-;; The echo area is unused most of the time. Sometimes this empty area so
-;; annoying that some people want to get rid of it. This package makes it
-;; useful by showing a status bar in it when it's unused. This is
-;; especially helpful when you use Emacs as your X window manager using
-;; EXWM.
+;; The echo area is unused most of the time. Sometimes this empty
+;; area so annoying that some people want to get rid of it. This
+;; package makes it useful by showing a status bar in it when it's
+;; unused. This is especially helpful when you use Emacs as your X
+;; window manager using EXWM.
;;
;; Usage:
;;
;; Enable `minibar-mode' to display minibar. You may want to put
-;; (minibar-mode +1) in your init file. There are several user options
-;; you can customize, use `customize-group' to see and possibly customize
-;; them.
+;; (minibar-mode +1) in your init file. There are several user
+;; options you can customize, use `customize-group' to discover and
+;; possibly customize them.
;;; Code:
@@ -57,22 +57,22 @@
(defcustom minibar-group-left nil
"Modules to be placed on the left of Minibar.
-The value should be a list of functions. Each function should return a
-string to display, or nil in case there is to show."
+The value should be a list of functions. Each function should return
+a string to display, or nil in case there is to show."
:type '(repeat function))
(defcustom minibar-group-middle '(minibar-module-time)
"Modules to be placed on the middle of Minibar.
-The value should be a list of functions. Each function should return a
-string to display, or nil in case there is to show."
+The value should be a list of functions. Each function should return
+a string to display, or nil in case there is to show."
:type '(repeat function))
(defcustom minibar-group-right nil
"Modules to be placed on the right of Minibar.
-The value should be a list of functions. Each function should return a
-string to display, or nil in case there is to show."
+The value should be a list of functions. Each function should return
+a string to display, or nil in case there is to show."
:type '(repeat function))
(defcustom minibar-update-interval 1
@@ -176,8 +176,8 @@ string to display, or nil in case there is to show."
(defvar minibar--module-battery-cache nil
"Cached battery status.
-The value is a cons cell whose car is the status and cdr is the time when
-it was recorded.")
+The value is a cons cell whose car is the status and cdr is the time
+when it was recorded.")
(defun minibar-module-battery ()
"Module for showing battery status."
@@ -196,9 +196,11 @@ it was recorded.")
(assq ?B status)
(assq ?h status)
(assq ?m status))
- (let ((load (floor (string-to-number (alist-get ?p status))))
+ (let ((load (floor (string-to-number
+ (alist-get ?p status))))
(state (alist-get ?b status))
- (remaining-hours (string-to-number (alist-get ?h status)))
+ (remaining-hours (string-to-number
+ (alist-get ?h status)))
(remaining-minutes (mod (string-to-number
(alist-get ?m status))
60)))
@@ -245,8 +247,8 @@ The value should be more than
(defvar minibar--module-temperature-cache nil
"Cached CPU temperature.
-The value is a cons cell whose car is the temperature and cdr is the time
-when it was recorded.")
+The value is a cons cell whose car is the temperature and cdr is the
+time when it was recorded.")
(defun minibar-module-temperature ()
"Module for showing CPU temperature."
@@ -266,18 +268,21 @@ when it was recorded.")
(if (char-displayable-p ?°) "°" " ")
"C")))
(if (>= temp minibar-module-temperature-high-threshold)
- (if (>= temp
- minibar-module-temperature-very-high-threshold)
- (propertize str 'face
- 'minibar-module-temperature-high-face)
- (propertize str 'face
- 'minibar-module-temperature-very-high-face))
+ (propertize
+ str 'face
+ (if (>=
+ temp
+ minibar-module-temperature-very-high-threshold)
+ 'minibar-module-temperature-high-face
+ 'minibar-module-temperature-very-high-face))
str))))
(current-time))))
(car minibar--module-temperature-cache))
(defcustom minibar-module-network-speeds-cache-for 1
- "Cache network speed values for this many seconds. Set to zero disable."
+ "Cache network speed values for this many seconds.
+
+Set to zero disable."
:type 'number)
(defvar minibar--module-network-speeds-last-byte-counts nil
@@ -286,14 +291,15 @@ when it was recorded.")
(defvar minibar--module-network-speeds-cache nil
"Cached network speeds.
-The value is a cons cell whose car is the speeds and cdr is the time when
-it was recorded.")
+The value is a cons cell whose car is the speeds and cdr is the time
+when it was recorded.")
(defun minibar-module-network-speeds ()
"Module for showing network speeds."
(when (or (not minibar--module-network-speeds-cache)
(>= (float-time
- (time-since (cdr minibar--module-network-speeds-cache)))
+ (time-since
+ (cdr minibar--module-network-speeds-cache)))
minibar-module-network-speeds-cache-for))
(setq
minibar--module-network-speeds-cache
@@ -354,7 +360,8 @@ it was recorded.")
(format "%%%ii %%s/s"
(if (string= unit "B") 4 3)))
rate unit)))))
- (setq minibar--module-network-speeds-last-byte-counts current)
+ (setq minibar--module-network-speeds-last-byte-counts
+ current)
(format "↑ %s ↓ %s"
(funcall formatter (car speeds))
(funcall formatter (cdr speeds)))))
@@ -368,8 +375,8 @@ it was recorded.")
(defvar minibar--module-cpu-cache nil
"Cached CPU load.
-The value is a cons cell whose car is the CPU load and cdr is the time when
-it was recorded.")
+The value is a cons cell whose car is the CPU load and cdr is the time
+when it was recorded.")
(defvar minibar--module-cpu-last-times nil
"Last CPU idle and total calculated.")
@@ -380,12 +387,14 @@ it was recorded.")
(defun minibar--module-cpu-calculate-load (cpu)
"Calculate CPU load."
(let* ((last-cell
- (let ((cell (assoc-string cpu minibar--module-cpu-last-times)))
+ (let ((cell (assoc-string
+ cpu minibar--module-cpu-last-times)))
(unless cell
(setq minibar--module-cpu-last-times
- (cons (cons cpu nil) minibar--module-cpu-last-times))
- (setq cell (assoc-string cpu
- minibar--module-cpu-last-times)))
+ (cons (cons cpu nil)
+ minibar--module-cpu-last-times))
+ (setq cell (assoc-string
+ cpu minibar--module-cpu-last-times)))
cell))
(last (cdr last-cell))
(now
@@ -433,7 +442,8 @@ it was recorded.")
(char-displayable-p ?▅) ; #x2585
(char-displayable-p ?▄) ; #x2584
(char-displayable-p ?▃) ; #x2583
- (char-displayable-p ?▂)) ; #x2582
+ (char-displayable-p ?▂) ; #x2582
+ (char-displayable-p ?▁)) ; #x2581
(concat
" "
(mapconcat
@@ -462,13 +472,14 @@ it was recorded.")
((and (char-displayable-p ?▂) ; #x2582
(>= load 12.5))
(propertize "▂" 'face 'bold))
- (t ; (char-displayable-p ? ) => t
+ (t ; (char-displayable-p ?▁) => t
(propertize
(if (char-displayable-p ?▁) ; #x2581
"▁"
" ")
'face
- '(:weight bold :inherit font-lock-comment-face))))))
+ '( :weight bold
+ :inherit font-lock-comment-face))))))
(number-sequence 0 (1- minibar--module-cpu-count)) ""))
"")))
(current-time))))
- [nongnu] elpa/minibar e6f7411c51 03/17: Rename to Minibar, (continued)
- [nongnu] elpa/minibar e6f7411c51 03/17: Rename to Minibar, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 8ecedf6d6c 02/17: Add COPYING, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar c995aec574 01/17: Add render and modules for time, CPU, temperature..., ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 2bf88ae60a 05/17: While updating, don't exit on input, that doesn't work on Emacs 28, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 2c50c766dd 07/17: Rename minibar--update to minibar-update, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 5e8afde8f7 13/17: Don't run module functions in temp buffer, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 1da37a9286 12/17: Update install instructions, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 46f3307cc9 10/17: Fix wrong argument order, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 8775f1584c 09/17: Use idle timer, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 9d650e3c71 14/17: Fix group positioning in minibuffer, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 3913de72e0 15/17: Try to make all lines less than 75 characters width,
ELPA Syncer <=
- [nongnu] elpa/minibar 9d1a459684 04/17: Don't depend on minibuffer-line, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar f228469970 06/17: Use char-displayable-p instead of display-graphic-p, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 0b02619c7f 11/17: Don't stop updating after first update after idle, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 45824cb137 17/17: Simplify character choosing logic in CPU module, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 37699eb25e 08/17: Don't use undocumented data in battery module, ELPA Syncer, 2022/11/27
- [nongnu] elpa/minibar 15896aa33a 16/17: Add .dir-locals.el, ELPA Syncer, 2022/11/27