2 Commits
0.7.3 ... 0.7.2

Author SHA1 Message Date
955a27f606 Fix value type issue in `eshell-info-banner--get-memory-gnu' 2021-11-15 10:05:46 +01:00
494a90dcb1 Update README, package is now in melpa
Update recipes for installing package

Add MELPA badge
2021-11-14 19:01:34 +01:00
2 changed files with 9 additions and 10 deletions

View File

@@ -1,6 +1,8 @@
#+title: eshell-info-banner.el #+title: eshell-info-banner.el
#+author: Lucien Cartier-Tilet #+author: Lucien Cartier-Tilet
#+email: lucien@phundrak.com #+email: lucien@phundrak.com
[[https://melpa.org/#/eshell-info-banner][file:https://melpa.org/packages/eshell-info-banner-badge.svg]]
* Introduction * Introduction
~eshell-info-banner.el~ is a utility for creating an informative banner, ~eshell-info-banner.el~ is a utility for creating an informative banner,
akin to ~fish_greeting~ but for Eshell. But an image is worth a thousand akin to ~fish_greeting~ but for Eshell. But an image is worth a thousand
@@ -60,12 +62,12 @@ your ~load-path~ and add the following to your ~.emacs~ or your ~init.el~:
(add-hook 'eshell-banner-load-hook 'eshell-info-banner-update-banner) (add-hook 'eshell-banner-load-hook 'eshell-info-banner-update-banner)
#+end_src #+end_src
If you use ~use-package~ only, you can then install it like so: If you use ~use-package~ only and install the package from MELPA, you
can then install it like so:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package eshell-info-banner (use-package eshell-info-banner
:ensure t :ensure t
:defer t :defer t
:load-path "~/path/to/where/you/cloned/it/eshell-info-banner.el/"
:hook (eshell-banner-load . eshell-info-banner-update-banner)) :hook (eshell-banner-load . eshell-info-banner-update-banner))
#+end_src #+end_src
@@ -74,15 +76,12 @@ In my case, I prefer using ~use-package~ with ~straight~:
(use-package eshell-info-banner (use-package eshell-info-banner
:ensure t :ensure t
:defer t :defer t
:straight (eshell-info-banner :type git :straight (:build t)
:host github
:repo "phundrak/eshell-info-banner.el")
:hook (eshell-banner-load . eshell-info-banner-update-banner)) :hook (eshell-banner-load . eshell-info-banner-update-banner))
#+end_src #+end_src
I personally also added ~:build t~ in the straight recipe to ensure You can just use ~:straight t~ if you do not want to ensure the package
Emacs compiles my package, both to ~.elc~ and ~.eln~ files (I am on Emacs gets compiled by Emacs.
28.0, ~feature/native-comp~ got merged into ~master~!)
There is probably a similar way to install it with pure ~straight.el~ or There is probably a similar way to install it with pure ~straight.el~ or
~quelpa~, but Im not knowledgable enough for that, feel free to create ~quelpa~, but Im not knowledgable enough for that, feel free to create

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.7.1 ;; Version: 0.7.2
;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1")) ;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1"))
;; Homepage: https://labs.phundrak.com/phundrak/eshell-info-banner.el ;; Homepage: https://labs.phundrak.com/phundrak/eshell-info-banner.el
@@ -402,7 +402,7 @@ For TEXT-PADDING and BAR-LENGTH, see the documentation of
; Memory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Memory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun eshell-info-banner--get-memory-gnu () (defun eshell-info-banner--get-memory-gnu ()
"Get memory usage for GNU/Linux and Hurd." "Get memory usage for GNU/Linux and Hurd."
(seq-do (lambda (line) (mapcar (lambda (line)
(let* ((line (split-string line " " t))) (let* ((line (split-string line " " t)))
(list (s-chop-suffix ":" (nth 0 line)) ; name (list (s-chop-suffix ":" (nth 0 line)) ; name
(string-to-number (nth 1 line)) ; total (string-to-number (nth 1 line)) ; total