Wednesday, 5 May 2010

Conky problematic in Lucid? Battery bar appears empty.

After upgrading to 10.04 on my laptop I found that the battery monitor bar was returning an empty bar with no data. Inspection of errors returned by running it in the terminal showed that conky was trying to identify the battery by the wrong portion of the script, specifically:

${battery_bar 7,65 BAT0}
Where it should have been attempting to lookup 'BAT0', it was actually looking up '7,65'. After double checking that the script had been written correctly, I attempted a reinstall from the repositories, to no avail! The solution ended up being just to download the source, compile and install.

Conky source can be found here, download the tarball of the latest version.

To install:

Ensure dependencies have been met:
sudo apt-get install lua5.1 liblua5.1-0-dev libxml2-dev build-essential libcurl4-gnutls-dev libx11-dev libxt-dev libxext6-dbg libxext-dev libxdamage-dev libxft-dev libimlib2-dev libglib2.0-dev
Find the Conky tarball you have downloaded and extract the contents to a convenient location, then navigate to this folder in the terminal.

Then, while in this directory, in the terminal:
sudo make install
And you're done! For convenience you could use a program called checkinstall to autobuild a deb, so that it is easier to remove or upgrade conky at a later date.

To do this simply replace 'sudo make install' with 'sudo checkinstall'. Follow the steps and enjoy Conky!


  1. Thank you so much, is work it again.

  2. Without compilation, I just switched the arguments in .conkyrc and have it working again:
    ${battery_bar BAT0 10,300}
    HTH :)

  3. the new systax for the $battery_bar variable is:
    ${battery_bar num height,width}
    num is your battery's id
    But the problem is that height and width arguments won't work. plz help :(

  4. Thanks, now everything works as it should! :D

  5. it works as the 2nd anonymous said.
    ${battery_bar BAT0 25,130}

  6. For now you just have to add the conky repository

    sudo apt-add-repository ppa:norsetto/ppa
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install conky-all

  7. hi.ihave installed libs that u say with sudo apt-get installed. Then i can not run any program.After that i restarted my computer and my ubuntu doesnt start.It wait ubuntu loading screen.Can u help me i can not use my ubuntu because of this libs

  8. Nothing here will have that effect. So this timing of the problem is almost certainly incidental.

    More information please. What version and architecture of Ubuntu are you using? Are there any error messages visible? (try pressing escape). Have you recently made any other changes or run any updates?

  9. Im using ubuntu 10.04 .Loading hangs when "checking battery state".

  10. Does your laptop have an intel graphics chip? If so, then this would sseem to be related -