Revision as of 03:01, 5 April 2012 by Kindahero (customization)
|Description||Shows the battery status in the mode line|
|Part of Emacs||yes|
- M-x display-battery-mode
- Add your battery status to the Modeline
- M-x battery
- View battery status
How to show battery status only on laptop?
if a device have no battery, we don't want to display-battery-mode be enabled.
(require 'battery) (when (and battery-status-function (not (string-match-p "N/A" (battery-format "%B" (funcall battery-status-function))))) (display-battery-mode 1))