Improve (hopefully) check for battery before displaying in modeline
This commit is contained in:
parent
3a70aa9cd9
commit
3a9f4294cf
|
@ -231,9 +231,12 @@ Removed in favour of [[https://github.com/catppuccin/emacs][Catppuccin (emacs)]]
|
||||||
#+end_src
|
#+end_src
|
||||||
** Battery state for laptops
|
** Battery state for laptops
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(with-eval-after-load 'battery
|
(require 'battery)
|
||||||
(when (battery-upower)
|
(when (and battery-status-function
|
||||||
(display-battery-mode +1)))
|
(not ( string-match-p "unknown"
|
||||||
|
( battery-format "%B"
|
||||||
|
(funcall battery-status-function)))))
|
||||||
|
(display-battery-mode +1))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Dashboard
|
* Dashboard
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
Loading…
Reference in a new issue