You are not logged in.

#1 2011-10-14 10:45:45

anirudh215
Member
Registered: 2011-03-07
Posts: 78

[SOLVED] Conky Battery Monitor

I've setup conky to do have a battery monitor bar. However, it always says zero %. How do I modify this? Here is the relevant line from the conkyrc:

Battery:${voffset 2} ${battery_bar 5,150} ${battery_percent}%

EDIT: For those of you facing the same problem, add 'BAT1' after '5,150' and 'battery_percent'.

Last edited by anirudh215 (2011-10-22 07:41:30)

Offline

#2 2011-10-14 10:51:59

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,360

Re: [SOLVED] Conky Battery Monitor

anirudh215 has informed me that he solved this problem through searching just after posting the message.

@anirudh215, please mark the thread [solved] and either post a link to your solution or the solution itself here so future readers won't have a hanging thread.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2011-10-25 10:48:46

junkie
Member
From: Hungary
Registered: 2011-10-12
Posts: 20

Re: [SOLVED] Conky Battery Monitor

What if this doesn't apply in my case? I did what is told here, also tried BAT0, still stuck at 0% all the time.

What else does conky need to be able to pick up the charge %?

If I run acpi, this is what I get:

Battery 0: Full, 100%, rate information unavailable

(the 100% bit changes when discharging)

Offline

#4 2011-10-25 10:52:41

heatblazer
Member
Registered: 2011-09-03
Posts: 26

Re: [SOLVED] Conky Battery Monitor

I am having a similar issue here on xfce4. Battery is either on red status or full. No warning no attentions when charging it remains almost empty but indicates charging...

Offline

#5 2011-10-25 12:21:06

junkie
Member
From: Hungary
Registered: 2011-10-12
Posts: 20

Re: [SOLVED] Conky Battery Monitor

To hell with conky's variables! Try this:

Command to get battery percent:

acpi -b | awk "{print $1}" | sed 's/\([^:]*\): \([^,]*\), \([0-9]*\)%.*/\3/'

Command to get charger status ("discharging" / "charging" / "full"):

acpi -b | awk "{print $1}" | sed 's/\([^:]*\): \([^,]*\), \([0-9]*\)%.*/\2/'

Notice that the only difference is the index of the match in the sed expression: the second group is the status text, the third group is the percent value.

Last edited by junkie (2011-10-25 12:24:49)

Offline

Board footer

Powered by FluxBB