Topic: really basic: remaining battery time and percent in conky (wheezy)

Hi guys,

I am most likely to blame for something (I always am) but anyways:  conky's battery_bar etc. did not work for me. So I googled and found references to at proc file i could concatenate. However, I don't have a battery file in my /proc dir, so this I what I did instead:

Remaining: ${execi 60 acpi -b | awk '{print$5}'} ${alignr} (${execi 60 acpi -b | awk '{print $4}' | cut -b -3})       

Extremely simple - but since I could find the solution to the problem I had, maybe this will help someone.

Good day
Andreas

Re: really basic: remaining battery time and percent in conky (wheezy)

hmm, all i see is a line "remaining" a space and then two brackets close to each other.. but I just copied your line over and am probably to blame for something, too..

Last edited by saneks (2011-04-13 09:08:56)

eee701/4gb/512ram

Re: really basic: remaining battery time and percent in conky (wheezy)

what happens if you call

acpi -b

in terminal? You should get something like:

Battery 0: Discharging, 100%, 04:35:22 remaining

The above commands works then takes that output, and feeds it to awk, which then takes the 5th field (the time). The same thing is happening with the next command, only I now take the fourth field (remaining percent). (I use cut to only show 3 charachters)

If you dont have acpi - then maybe install it?

Re: really basic: remaining battery time and percent in conky (wheezy)

I'm not sure if it's because it's Statler or not, but I get no response from:

acpi -b

other than:

bash: acpi: command not found

Fortune favors the bold.
#! Statler
Asus EEEPC 1001PXD
2GB RAM

Re: really basic: remaining battery time and percent in conky (wheezy)

sudo aptitude install acpi

Ha ezt el tudod olvasni, biztosan nem vagy rövidlátó.

Re: really basic: remaining battery time and percent in conky (wheezy)

Ah, thanks for the install tip. I was apt-getting but getting nowhere (still fairly new).

Here's what I get from:

/etc/pm/power.d$ acpi -b

Battery 0: Full, 100%

That's when it's plugged in.

And here's with it unplugged...

Battery 0: Discharging, 100%, 03:10:13 remaining

So that works. But the 'remaining' line in my conky just has (100) in it with no time code...

Last edited by typewriterjason (2011-08-30 07:03:47)

Fortune favors the bold.
#! Statler
Asus EEEPC 1001PXD
2GB RAM

Re: really basic: remaining battery time and percent in conky (wheezy)

Post your issue in the "Monthly Conky" forums, you get an answer at once smile
http://crunchbanglinux.org/forums/topic … ky-thread/

Nothing right in the left brain. Nothing left in the right brain.