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

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

[nongnu] elpa/minibar e6f7411c51 03/17: Rename to Minibar


From: ELPA Syncer
Subject: [nongnu] elpa/minibar e6f7411c51 03/17: Rename to Minibar
Date: Sun, 27 Nov 2022 16:01:35 -0500 (EST)

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

    Rename to Minibar
---
 README.org                |  18 ++---
 miniline.el => minibar.el | 196 +++++++++++++++++++++++-----------------------
 2 files changed, 107 insertions(+), 107 deletions(-)

diff --git a/README.org b/README.org
index 228928a3f1..01b56ed853 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-#+title: Miniline - Modular status bar in echo area
+#+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
@@ -10,30 +10,30 @@ helpful when you use Emacs as your X window manager using 
EXWM.
 ** Quelpa
 
 #+begin_src emacs-lisp
-(quelpa '(miniline :fetcher git
-                   :url "https://codeberg.org/akib/emacs-miniline.git";))
+(quelpa '(minibar :fetcher git
+                  :url "https://codeberg.org/akib/emacs-minibar.git";))
 #+end_src
 
 ** Straight.el
 
 #+begin_src emacs-lisp
 (straight-use-package
- '(miniline :type git
-            :repo "https://codeberg.org/akib/emacs-miniline.git";))
+ '(minibar :type git
+           :repo "https://codeberg.org/akib/emacs-minibar.git";))
 #+end_src
 
 ** Manual
 
 First install =minibuffer-line= package from ELPA.  Then download
-=miniline.el= and put it in your ~load-path~.
+=minibar.el= and put it in your ~load-path~.
 
 * Usage
 
-Enable ~miniline-mode~ to display miniline.  You may want to put
-~(miniline-mode +1)~ in your init file.  There are several user options you
+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.
 
-Miniline renders the status bar and it uses =minibuffer-line= package to
+Minibar renders the status bar and it uses =minibuffer-line= package to
 show the line in echo area.  To change the refresh rate, customize the
 ~minibuffer-line-refresh-interval~ variable.  To change the face, customize
 the ~minibuffer-line~ face.
diff --git a/miniline.el b/minibar.el
similarity index 71%
rename from miniline.el
rename to minibar.el
index c1c80ef46f..2ebcea2131 100644
--- a/miniline.el
+++ b/minibar.el
@@ -1,4 +1,4 @@
-;;; miniline.el --- Modular status bar in echo area -*- lexical-binding: t -*-
+;;; minibar.el --- Modular status bar in minibuffer -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2022 Akib Azmain Turja.
 
@@ -6,7 +6,7 @@
 ;; Version: 0.1
 ;; Package-Requires: ((emacs "27.2") minibuffer-line)
 ;; Keywords: calendar, hardware
-;; URL: https://codeberg.org/akib/emacs-miniline
+;; URL: https://codeberg.org/akib/emacs-minibar
 
 ;; This file is not part of GNU Emacs.
 
@@ -33,12 +33,12 @@
 ;;
 ;; Usage:
 ;;
-;; Enable `miniline-mode' to display miniline.  You may want to put
-;; (miniline-mode +1) in your init file.  There are several user options
+;; 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.
 ;;
-;; Miniline renders the status bar and it uses `minibuffer-line' package
+;; Minibar renders the status bar and it uses `minibuffer-line' package
 ;; to show the line in echo area.  To change the refresh rate, customize
 ;; the `minibuffer-line-refresh-interval' variable.  To change the face,
 ;; customize the `minibuffer-line' face.
@@ -47,71 +47,71 @@
 
 (require 'minibuffer-line)
 
-(defgroup miniline nil
+(defgroup minibar nil
   "Modular status bar in echo bar."
   :group 'tools
-  :link '(url-link "https://codeberg.org/akib/emacs-miniline";)
-  :prefix "miniline-")
+  :link '(url-link "https://codeberg.org/akib/emacs-minibar";)
+  :prefix "minibar-")
 
-(defcustom miniline-module-separator "  "
+(defcustom minibar-module-separator "  "
   "Separator to separate modules."
   :type 'string)
 
-(defcustom miniline-group-separator "     "
+(defcustom minibar-group-separator "     "
   "Separator to separate groups."
   :type 'string)
 
-(defcustom miniline-group-left nil
-  "Modules to be placed on the left of `miniline'.
+(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."
   :type '(repeat function))
 
-(defcustom miniline-group-middle '(miniline-module-time)
-  "Modules to be placed on the middle of `miniline'.
+(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."
   :type '(repeat function))
 
-(defcustom miniline-group-right nil
-  "Modules to be placed on the right of `miniline'.
+(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."
   :type '(repeat function))
 
-(defun miniline--render-group (modules)
+(defun minibar--render-group (modules)
   "Render MODULES."
   (mapconcat #'identity (delete nil (mapcar #'funcall modules))
-             miniline-module-separator))
+             minibar-module-separator))
 
 ;;;###autoload
-(defun miniline-render ()
-  "Render Miniline."
+(defun minibar-render ()
+  "Render Minibar."
   (with-temp-buffer
     (let ((bar "")
           (width (frame-width (window-frame (minibuffer-window))))
-          (left (miniline--render-group
-                 miniline-group-left))
-          (middle (miniline--render-group
-                   miniline-group-middle))
-          (right (miniline--render-group
-                  miniline-group-right)))
+          (left (minibar--render-group
+                 minibar-group-left))
+          (middle (minibar--render-group
+                   minibar-group-middle))
+          (right (minibar--render-group
+                  minibar-group-right)))
 
       ;; HACK: Emacs doesn't show the last character on terminal, so
       ;; decrease the width by one in that case.
       (unless (display-graphic-p)
         (setq width (1- width)))
       (unless (zerop (length left))
-        (setq bar (concat left miniline-group-separator)))
+        (setq bar (concat left minibar-group-separator)))
       (unless (zerop (length middle))
         (setq bar (concat bar (make-list
                               (max 0 (- (/ (- width (length middle)) 2)
                                         (length bar)))
                                ? )
-                          middle miniline-group-separator)))
+                          middle minibar-group-separator)))
       (unless (zerop (length right))
         (setq bar (concat bar (make-list
                               (max 0 (- width (length right)
@@ -122,56 +122,56 @@ string to display, or nil in case there is to show."
        "%" "%%" (format (format "%%-%i.%is" width width) bar)))))
 
 ;;;###autoload
-(define-minor-mode miniline-mode
-  "Toggle Miniline display."
+(define-minor-mode minibar-mode
+  "Toggle Minibar display."
   :init-value nil
-  :lighter " Miniline"
+  :lighter " Minibar"
   :keymap nil
   :global t
-  (if miniline-mode
+  (if minibar-mode
       (progn
-        (setq minibuffer-line-format '(:eval (miniline-render)))
+        (setq minibuffer-line-format '(:eval (minibar-render)))
         (minibuffer-line-mode +1))
     (setq minibuffer-line-format
           (ignore-errors
             (eval (car (get 'minibuffer-line-format 'standard-value)))))
     (minibuffer-line-mode -1)))
 
-(defcustom miniline-module-time-format "%a %b %d %H:%M"
+(defcustom minibar-module-time-format "%a %b %d %H:%M"
   "Time format for time module."
   :type 'string)
 
-(defun miniline-module-time ()
+(defun minibar-module-time ()
   "Module for showing time."
-  (format-time-string miniline-module-time-format))
+  (format-time-string minibar-module-time-format))
 
-(defcustom miniline-module-battery-cache-for 60
+(defcustom minibar-module-battery-cache-for 60
   "Cache battery status for this many seconds.  Set to zero disable."
   :type 'number)
 
-(defcustom miniline-module-battery-low-threshold 30
+(defcustom minibar-module-battery-low-threshold 30
   "When battery is less than this many percent, treat it as low."
   :type 'number)
 
-(defface miniline-module-battery-low-face
+(defface minibar-module-battery-low-face
   '((t :inherit warning))
   "Face to use when battery is low.")
 
-(defvar miniline--module-battery-cache nil
+(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.")
 
-(defun miniline-module-battery ()
+(defun minibar-module-battery ()
   "Module for showing battery status."
-  (when (or (not miniline--module-battery-cache)
+  (when (or (not minibar--module-battery-cache)
             (>= (float-time
-                 (time-since (cdr miniline--module-battery-cache)))
-                miniline-module-battery-cache-for))
+                 (time-since (cdr minibar--module-battery-cache)))
+                minibar-module-battery-cache-for))
     (require 'battery nil t)
     (setq
-     miniline--module-battery-cache
+     minibar--module-battery-cache
      (cons
       (let ((status (when (boundp 'battery-status-function)
                       (funcall battery-status-function))))
@@ -190,7 +190,7 @@ it was recorded.")
              (if (and (< load 30)
                       (not charging))
                  (propertize (format "%i%%" load) 'face
-                             'miniline-module-battery-low-face)
+                             'minibar-module-battery-low-face)
                (format "%s%%" load))
              (if charging "+" " ")
              (if (eq load 100)
@@ -198,48 +198,48 @@ it was recorded.")
                (format "(%02i:%02i)" remaining-hours
                        remaining-minutes))))))
       (current-time))))
-  (car miniline--module-battery-cache))
+  (car minibar--module-battery-cache))
 
-(defcustom miniline-module-temperature-cache-for 5
+(defcustom minibar-module-temperature-cache-for 5
   "Cache CPU temperature for this many seconds.  Set to zero disable."
   :type 'number)
 
-(defcustom miniline-module-temperature-high-threshold 70
+(defcustom minibar-module-temperature-high-threshold 70
   "When temperature is more than this many percent, treat it as high.
 
 The value should be less than
-`miniline-module-temperature-very-high-threshold'."
+`minibar-module-temperature-very-high-threshold'."
   :type 'number)
 
-(defcustom miniline-module-temperature-very-high-threshold 90
+(defcustom minibar-module-temperature-very-high-threshold 90
   "When temperature is more than this many percent, treat it as very high.
 
 The value should be more than
-`miniline-module-temperature-high-threshold'."
+`minibar-module-temperature-high-threshold'."
   :type 'number)
 
-(defface miniline-module-temperature-high-face
+(defface minibar-module-temperature-high-face
   '((t :inherit warning))
   "Face to use when temperature is high.")
 
-(defface miniline-module-temperature-very-high-face
+(defface minibar-module-temperature-very-high-face
   '((t :inherit error))
   "Face to use when temperature is very high.")
 
-(defvar miniline--module-temperature-cache nil
+(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.")
 
-(defun miniline-module-temperature ()
+(defun minibar-module-temperature ()
   "Module for showing CPU temperature"
-  (when (or (not miniline--module-temperature-cache)
+  (when (or (not minibar--module-temperature-cache)
             (>= (float-time
-                 (time-since (cdr miniline--module-temperature-cache)))
-                miniline-module-temperature-cache-for))
+                 (time-since (cdr minibar--module-temperature-cache)))
+                minibar-module-temperature-cache-for))
     (setq
-     miniline--module-temperature-cache
+     minibar--module-temperature-cache
      (cons
       (let ((zone 0))
         (with-temp-buffer
@@ -249,40 +249,40 @@ when it was recorded.")
                  (str (concat (int-to-string temp)
                               (if (char-displayable-p ?°) "°" " ")
                               "C")))
-            (if (>= temp miniline-module-temperature-high-threshold)
+            (if (>= temp minibar-module-temperature-high-threshold)
                 (if (>= temp
-                        miniline-module-temperature-very-high-threshold)
+                        minibar-module-temperature-very-high-threshold)
                     (propertize str 'face
-                                'miniline-module-temperature-high-face)
+                                'minibar-module-temperature-high-face)
                   (propertize str 'face
-                              'miniline-module-temperature-very-high-face))
+                              'minibar-module-temperature-very-high-face))
               str))))
       (current-time))))
-  (car miniline--module-temperature-cache))
+  (car minibar--module-temperature-cache))
 
-(defcustom miniline-module-network-speeds-cache-for 1
+(defcustom minibar-module-network-speeds-cache-for 1
   "Cache network speed values for this many seconds.  Set to zero disable."
   :type 'number)
 
-(defvar miniline--module-network-speeds-last-byte-counts nil
+(defvar minibar--module-network-speeds-last-byte-counts nil
   "Total sent bytes and received bytes previously calculated.")
 
-(defvar miniline--module-network-speeds-cache nil
+(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.")
 
-(defun miniline-module-network-speeds ()
+(defun minibar-module-network-speeds ()
   "Module for showing network speeds."
-  (when (or (not miniline--module-network-speeds-cache)
+  (when (or (not minibar--module-network-speeds-cache)
             (>= (float-time
-                 (time-since (cdr miniline--module-network-speeds-cache)))
-                miniline-module-network-speeds-cache-for))
+                 (time-since (cdr minibar--module-network-speeds-cache)))
+                minibar-module-network-speeds-cache-for))
     (setq
-     miniline--module-network-speeds-cache
+     minibar--module-network-speeds-cache
      (cons
-      (let ((previous miniline--module-network-speeds-last-byte-counts)
+      (let ((previous minibar--module-network-speeds-last-byte-counts)
             (current
              (cons (current-time)
                    (with-temp-buffer
@@ -338,38 +338,38 @@ it was recorded.")
                               (format "%%%ii %%s/s"
                                       (if (string= unit "B") 4 3)))
                             rate unit)))))
-          (setq miniline--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)))))
       (current-time))))
-  (car miniline--module-network-speeds-cache))
+  (car minibar--module-network-speeds-cache))
 
-(defcustom miniline-module-cpu-cache-for 1
+(defcustom minibar-module-cpu-cache-for 1
   "Cache CPU load values for this many seconds.  Set to zero disable."
   :type 'number)
 
-(defvar miniline--module-cpu-cache nil
+(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.")
 
-(defvar miniline--module-cpu-last-times nil
+(defvar minibar--module-cpu-last-times nil
   "Last CPU idle and total calculated.")
 
-(defvar miniline--module-cpu-count nil
+(defvar minibar--module-cpu-count nil
   "Count of processor or CPU.")
 
-(defun miniline--module-cpu-calculate-load (cpu)
+(defun minibar--module-cpu-calculate-load (cpu)
   "Calculate CPU load."
   (let* ((last-cell
-          (let ((cell (assoc-string cpu miniline--module-cpu-last-times)))
+          (let ((cell (assoc-string cpu minibar--module-cpu-last-times)))
             (unless cell
-              (setq miniline--module-cpu-last-times
-                    (cons (cons cpu nil) miniline--module-cpu-last-times))
+              (setq minibar--module-cpu-last-times
+                    (cons (cons cpu nil) minibar--module-cpu-last-times))
               (setq cell (assoc-string cpu
-                                       miniline--module-cpu-last-times)))
+                                       minibar--module-cpu-last-times)))
             cell))
          (last (cdr last-cell))
          (now
@@ -394,29 +394,29 @@ it was recorded.")
                (/ (float diff-active) diff-total)))
          0.0))))
 
-(defun miniline-module-cpu ()
+(defun minibar-module-cpu ()
   "Module for showing CPU loads."
-  (when (or (not miniline--module-cpu-cache)
+  (when (or (not minibar--module-cpu-cache)
             (>= (float-time
-                 (time-since (cdr miniline--module-cpu-cache)))
-                miniline-module-cpu-cache-for))
+                 (time-since (cdr minibar--module-cpu-cache)))
+                minibar-module-cpu-cache-for))
     (setq
-     miniline--module-cpu-cache
+     minibar--module-cpu-cache
      (cons
       (with-temp-buffer
         (insert-file-contents "/proc/stat")
-        (unless miniline--module-cpu-count
-          (setq miniline--module-cpu-count
+        (unless minibar--module-cpu-count
+          (setq minibar--module-cpu-count
                 (string-to-number (shell-command-to-string "nproc"))))
         (format
          "%3i%%%s"
-         (miniline--module-cpu-calculate-load "cpu")
+         (minibar--module-cpu-calculate-load "cpu")
          (if (display-graphic-p)
              (concat
               " "
               (mapconcat
                (lambda (i)
-                 (let ((load (miniline--module-cpu-calculate-load
+                 (let ((load (minibar--module-cpu-calculate-load
                               (format "cpu%i" i))))
                    (cond
                     ((>= load 87.5)
@@ -437,10 +437,10 @@ it was recorded.")
                      (propertize
                       (string #x2581) 'face
                       '(:weight bold :inherit font-lock-comment-face))))))
-               (number-sequence 0 (1- miniline--module-cpu-count)) ""))
+               (number-sequence 0 (1- minibar--module-cpu-count)) ""))
            "")))
       (current-time))))
-  (car miniline--module-cpu-cache))
+  (car minibar--module-cpu-cache))
 
-(provide 'miniline)
-;;; miniline.el ends here
+(provide 'minibar)
+;;; minibar.el ends here



reply via email to

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