I'm not sure whether you can do that with the built-in display-battery-mode
. It's not very customizable in this regard, and you may have to resort to heavy advises to change the built-in mode as you like.
I wrote fancy-battery.el some time ago to provide a more customizable indicator for the battery status. Notably, I wanted to indicate the state of the battery with colours, but the package is flexible enough to allow for your use case as well, by changing fancy-battery-mode-line
accordingly:
(setq fancy-battery-mode-line
'(:eval (unless (equal (cdr (assq ?b fancy-battery-last-status)) "+")
(fancy-battery-default-mode-line))))
Don't ask, the status comes from battery.el, which has a horrible API. Just trust me that ?b
is the battery state, and "+"
indicates charging, for most backends at least.
This setting will show the battery status, but only if the battery is discharging. To use another format, write your own function to replace fancy-battery-default-mode-line
. Feel free to take mine as inspritation.
Regarding the temperature, you may have luck with a different backend. Take a look at the existing backends in battery.el
, search for one that includes battery temperature and try to fulfil it's requirements. However, battery.el
typically succeeds at picking the best backend for your system, so quite likely your hardware simply does not report the battery temperature, or is not properly supported by your OS.