information for multiple batteries

Jose A. Ortega Ruiz jao at gnu.org
Fri Jun 28 14:28:32 BST 2013


Hi Tamas,

On Fri, Jun 28 2013, Tamas Papp wrote:

> Hi,
>
> I have a laptop with 2 batteries (a main one and one in the ultrabay).
> I am trying to have xmonad display information (at least percentage of
> charge left, and charge/discharge status) for both.  But I could not
> figure out how to do this, I can use two BatteryP commands but the
> %battery% alias will always use only one of them.

Actually, what BatteryP is doing is showing a combination of the values
for all supplied batteries (or at least, that's what the code tries to
do).  But yes, it doesn't provide separate readings.

> Is there a way to do this with xmobar, or should I just hack something
> together using external commands and a shell script?

There was no way... if you can use the git version of xmobar, i've just
pushed a patch that provides BatteryN, which works like BatteryP except
that in the configuration you pass a name for the alias; that should
allow you set up a monitor per battery.  If you have a chance to try it,
let me know if it works!

Cheers,
jao
-- 
Be humble, for you are made of earth.
Be noble, for you are made of stars.
  -Serbian proverb



More information about the Xmobar mailing list