I have a setting in my .emacs like this
(display-battery-mode 1). It displays my battery status on mode line. That helps me when i am on laptop with fullscreen. But it goes ugly when i am working on desktop [N/A%][N/A C].
So I would like to make it on only when I am working on laptop.
like
(if OnLaptop
(display-battery-mode 1))
Thanks.
UPDATE:
they both are running Linux(Ubuntu)
I’d use the internals of the
batterypackage to determine whether or not the battery information was available. This code snippet should do the trick for you: