You are not logged in.

#1 2007-09-11 05:55:02

synthead
Member
Registered: 2006-05-09
Posts: 1,337

[solved] Battery meter in conky?

What's the trick?  When I put ${battery} in .conkyrc, it doesn't show anything at all tongue

Last edited by synthead (2007-09-14 07:25:48)

Offline

#2 2007-09-11 06:04:57

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [solved] Battery meter in conky?

${battery BAT1}
or whatever number your battery is...
you can also get battery time left with
${battery_time BAT1}

Offline

#3 2007-09-11 06:29:01

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: [solved] Battery meter in conky?

Nice, worked great!

But what if I want to display the percentage without displaying "discharging"?

Offline

#4 2007-09-11 13:18:55

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [solved] Battery meter in conky?

You could probably do it this way:

1) Create a script called, say, readbattery.sh which looks something like that:

#!/bin/bash
acpi -b | awk '{print $4}' | sed -e s/,//

2) Make the script executable.
3) Call it from conky usung "execi" command.  Something like

${execi 30 /path/to/readbattery.sh}

would execute the screen every 30 seconds and update the battery charge level info appropriately.

Last edited by fwojciec (2007-09-11 13:25:03)

Offline

#5 2007-09-11 18:07:25

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: [solved] Battery meter in conky?

Well, aren't you clever.

I'll try it when I get back home, thanks for sharing your expertise!

Offline

#6 2007-09-11 20:02:12

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [solved] Battery meter in conky?

Not my clever idea, actually wink  Found this solution, or similar, somewhere on these forums a while back (here: http://bbs.archlinux.org/viewtopic.php?id=34647), and just made some simple changes to the script so it does what you wanted (just the percentage).  This is just to clarify...  So be thankful for the communal expertise of Arch community, I guess tongue  Let me know if it works, it should work...

Last edited by fwojciec (2007-09-11 20:05:46)

Offline

#7 2007-09-11 20:04:23

xsdnyd
Member
Registered: 2007-04-28
Posts: 110

Re: [solved] Battery meter in conky?

you can also use ${battery_percent BAT1}


We can't stop here! This is bat country!!

Offline

#8 2007-09-11 20:10:42

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [solved] Battery meter in conky?

xsdnyd wrote:

you can also use ${battery_percent BAT1}

Even better!  Duh!  Communal expertise in action smile

Offline

#9 2007-09-14 07:25:25

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: [solved] Battery meter in conky?

nice, works great now, really appreciate it guys! xyxthumbs.gif

Offline

#10 2017-05-11 13:39:10

BatteryBilly
Member
Registered: 2017-05-11
Posts: 2

Re: [solved] Battery meter in conky?

sorry to raise a 10 year old thread...but i found it helpful...when i thought to try BAT0 smile

First I tried changing BAT1 to BAT2, and then just BAT [but you need a #!]
so, i almost gave up...almost...but not quite, i knew i had to try BAT0 and it worked big_smile


I spent far too much time making an 80x80 avatar... + / -

Offline

#11 2017-05-11 14:27:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [solved] Battery meter in conky?

BatteryBilly wrote:

sorry to raise a 10 year old thread

If you know it's wrong, don't do it.

Closed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB