diff --git a/init.el b/init.el index cab8676..18b73c5 100644 --- a/init.el +++ b/init.el @@ -307,8 +307,15 @@ (line-number-mode -1) (column-number-mode -1) (size-indication-mode +1) -(display-time-mode -1) -(display-battery-mode -1) + +(require 'battery) +(when (and battery-status-function + (not ( string-match-p "unknown" + ( battery-format "%B" + (funcall battery-status-function))))) + (display-battery-mode +1)) + +(display-time-mode +1) (use-package diff-hl :functions (diff-hl-magit-pre-refresh