Display battery status in Emacs mode line (Solarized Light):
fancy-battery-mode, which is like the built-in
display-battery-mode, but more fancy: It shows just the remaining time, and
uses colours to indicate the status of the battery. It is also more
(source melpa) (depends-on "fancy-battery")
(add-hook 'after-init-hook #'fancy-battery-mode)
When the battery is charging, Fancy Battery shows the remaining time until full
fancy-battery-charging face, which inherits from the built-in
If no information about the remaining time is available, it falls back to
the charge level of the battery. If you prefer to always see the charge level,
When the AC plug is disconnected, the text changes to the
fancy-battery-discharging face, which inherits from the built-in
face. The time now indicates how long the battery will last.
As soon as the battery level gets critically low, the face changes to
fancy-battery-critical, which inherits form the built-in
error face, to
indicate that you should really grab the AC plug now:
Note: On OS X Emacs currently fails to report critical battery status due to
an issue in
battery-pmset. See Emacs bug #18157 for details.
Add your own functions to
fancy-battery-status-update-functions to receive
battery status updates.
fancy-battery-discharging to change the status colours used by the default
mode line format.
fancy-battery-show-percentage to a non-nil value to show the load
percentage instead of the remaining time. To use an entirely different format,
fancy-battery-mode-line. See Mode Line Format for documentation
of the format, and take a look at
fancy-battery-default-mode-line to see how
the default value is built.
mode-line-format to change the position at
which the battery status appears in the mode line. Typically it's at the very
end after the minor mode list, so you may want to move
more to the front of
battery-update-interval to change the interval at which battery
information is updated, and
battery-status-function to add your own battery
All options are available via
M-x customize-group RET fancy-battery.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
COPYING for details.