3 Commits
0.8.3 ... 0.8.4

2 changed files with 7 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
;; Author: Lucien Cartier-Tilet <lucien@phundrak.com> ;; Author: Lucien Cartier-Tilet <lucien@phundrak.com>
;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com> ;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com>
;; Version: 0.8.3 ;; Version: 0.8.4
;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1")) ;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1"))
;; Homepage: https://github.com/Phundrak/eshell-info-banner.el ;; Homepage: https://github.com/Phundrak/eshell-info-banner.el
@@ -237,7 +237,9 @@ Ensures the command is ran with LANG=C."
"Display a progress bar without its prefix. "Display a progress bar without its prefix.
Display a progress bar of BAR-LENGTH length, followed by an Display a progress bar of BAR-LENGTH length, followed by an
indication of how full the memory is with a human readable USED indication of how full the memory is with a human readable USED
and TOTAL size." and TOTAL size.
Optional argument NEWLINE: Whether to output a newline at the end
of the progress bar."
(let ((percentage (if (= used 0) (let ((percentage (if (= used 0)
0 0
(/ (* 100 used) total)))) (/ (* 100 used) total))))
@@ -468,6 +470,8 @@ For TEXT-PADDING and BAR-LENGTH, see the documentation of
t))) t)))
(defun eshell-info-banner--get-memory-unix-command-to-mem (command) (defun eshell-info-banner--get-memory-unix-command-to-mem (command)
"Get the output of COMMAND corresponding to memory information.
This function is to be only used on platforms which support sysctl."
(string-to-number (string-to-number
(s-trim (s-trim
(car (last (car (last
@@ -478,7 +482,7 @@ For TEXT-PADDING and BAR-LENGTH, see the documentation of
(defun eshell-info-banner--get-memory-netbsd () (defun eshell-info-banner--get-memory-netbsd ()
"Get memory usage for NetBSD systems. "Get memory usage for NetBSD systems.
See `eshell-info-banner--get-memory'." See `eshell-info-banner--get-memory'."
(let* ((total (eshell-info-banner--get-memory-unix-command-to-mem `("sysctl hw.physmem64"))) (let* ((total (eshell-info-banner--get-memory-unix-command-to-mem "sysctl hw.physmem64"))
(used (- total (used (- total
(* 1024 (string-to-number (* 1024 (string-to-number
(s-trim (s-trim

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 54 KiB