Add autoload, banner updater and correct require
This commit is contained in:
parent
3d3e2b3bbe
commit
ccb4bf0c36
@ -30,6 +30,7 @@
|
|||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
(require 'dash)
|
(require 'dash)
|
||||||
(require 'f)
|
(require 'f)
|
||||||
|
(require 'em-banner)
|
||||||
|
|
||||||
; Groups ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
; Groups ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
@ -179,6 +180,7 @@ the left side of the banner."
|
|||||||
(len (max (length path) len)))
|
(len (max (length path) len)))
|
||||||
(eshell-info-banner--get-longest-path (cdr partitions) len)))))
|
(eshell-info-banner--get-longest-path (cdr partitions) len)))))
|
||||||
|
|
||||||
|
;; FIXME: There’s apparently an issue here selecting faces
|
||||||
(defun eshell-info-banner--get-color-percentage (percentage)
|
(defun eshell-info-banner--get-color-percentage (percentage)
|
||||||
"Display a `PERCENTAGE' with its according face."
|
"Display a `PERCENTAGE' with its according face."
|
||||||
(let ((percentage (if (stringp percentage)
|
(let ((percentage (if (stringp percentage)
|
||||||
@ -259,6 +261,7 @@ See also `eshell-info-banner--display-memory'."
|
|||||||
(number-to-string percentage)
|
(number-to-string percentage)
|
||||||
:inherit (eshell-info-banner--get-color-percentage percentage))))))
|
:inherit (eshell-info-banner--get-color-percentage percentage))))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
(defun eshell-info-banner ()
|
(defun eshell-info-banner ()
|
||||||
"Banner for Eshell displaying system information."
|
"Banner for Eshell displaying system information."
|
||||||
(let* ((partitions (eshell-info-banner--get-mounted-partitions))
|
(let* ((partitions (eshell-info-banner--get-mounted-partitions))
|
||||||
@ -322,6 +325,9 @@ See also `eshell-info-banner--display-memory'."
|
|||||||
"\n")
|
"\n")
|
||||||
(format "\n%s\n" (s-repeat tot-width eshell-info-banner-progress-bar-char)))))
|
(format "\n%s\n" (s-repeat tot-width eshell-info-banner-progress-bar-char)))))
|
||||||
|
|
||||||
|
(defun eshell-info-banner-update-banner ()
|
||||||
|
"Update the Eshell banner."
|
||||||
|
(setq eshell-banner-message (eshell-info-banner)))
|
||||||
|
|
||||||
|
|
||||||
(provide 'eshell-info-banner)
|
(provide 'eshell-info-banner)
|
||||||
|
Loading…
Reference in New Issue
Block a user