topic title: Battery Monitor
Posts: 22
Craigus
Joined: 01 Nov 2007
#1
Conky can monitor many things. I wanted to add a battery monitor and system temperature monitor.

open .conkyrc (It's in your user directory) with leafpad:
# leafpad .conkyrc
Here's mine:
TEXT
${color white}$sysname $kernel
${color green}Uptime: $uptime
${color red}${time %a %d %b %k:%M}

${color white}Monitors:
${color blue}battery: ${color white}$acpiacadapter, ${battery_percent BAT1}%
${color green}cpu : ${color white}${cpu}%
${color green}temp: ${color red}$acpitemp
${color red}ram : ${color white}$mem${color white}/${color white}$memmax ${color white}- ${color green}$memperc%
${color red}swap: ${color white}$swap${color white}/${color white}$swapmax ${color white}- ${color green}$swapperc%
${color red}processes: ${color white}$processes ${color white}running: ${color white}$running_processes

${color white}Space:
${color green}Root:${color white} ${fs_free /} ${color green}= ${fs_free_perc /}%
Note that my battery is BAT1, yours may be BAT0.
Posts: 24
lcafiero
Joined: 21 Nov 2007
#2
This is very cool, Craigus, and thanks for the tip -- i added the temperature to my machine -- a Dell Inspiron 5000e laptop -- but I have a question.

Your battery line says:

${color blue}battery: ${color white}$acpiacadapter, ${battery_percent BAT1}%

However, when I do this, I get ${battery_percent BAT1}% appearing on my screen next to"on line" (which I'm assuming"on line" refers to the machine being plugged in). When I unplug it, same thing. I've also tried to change it to BAT0 and it still does the same thing.

Is there something wrong with that line, or is it my machine?

Larry Cafiero
Posts: 22
Craigus
Joined: 01 Nov 2007
#3
Hmm. Try :
${color blue}battery: ${color white}$acpiacadapter, $battery_percent %
instead. I don't see why it didn't work the other way though, unless your battery isn't BAT0 or BAT1. If you look in /proc/acpi/battery you should see the battery folder.


You could also try the other conky battery variables:
$battery
$battery_time

or even

$battery_bar
Posts: 24
lcafiero
Joined: 21 Nov 2007
#4
Hey, Craigus --

It seems to work in Lysistrata okay as you originally wrote it (!), so I can't really explain it. Could very well be a PEBKAC error.

While I'm on the subject, if you look at this desktop:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.imageposter.com/uploads/get/97494"
linktext was:"http://www.imageposter.com/uploads/get/97494"
====================================


Do you know how to get the items to go across the top of the screen like this?
Posts: 319
impuwat
Joined: 13 Sep 2007
#5
Open the .conkyrc file. You will see a few lines similar to this:
#position
gap_x 6
gap_y 6
alignment top_left
You can change those parameters for alignment to"top_left, top_right, bottom_left, bottom_right, or none" depending on where you want conky to show.

Go to:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://conky.sourceforge.net/"
linktext was:"http://conky.sourceforge.net/"
====================================


Under"Documentation" click on"# Pretty table of conky variables (1.4.9)" or"# Pretty table of conky config file settings (1.4.9)" to learn what your variables and options are.
Posts: 17
pjotr123
Joined: 09 Dec 2007
#6
Good tip!

In my case it worked only after a full, complete reboot.