Ever curious how many watts your laptop is using while running off its battery?
If you are using Kubuntu Fiesty, you can do it quite easily by making a quick modification to guidance-power-manager. ( if you are still using Edgy, it might work, but the line numbers will NOT be the same)
WARNING: if you do not know what you are doing, this can destroy guidance-power-manager. Even if you mess it up though, you can always reinstall it with apt. You have been warned.
Open up the guidance source code with:
“kdesu kate /usr/share/python-support/kde-guidance/guidance-power-manager.py”
First:
Go to line 659
Replace “blabel += i18n(” %i:%02ih remaining” % (remain_h,remain_m))”
with “blabel += i18n(” %i:%02ih remaining; discharging at %3i watts ” % (remain_h,remain_m,watts))”
Make sure you preserve the original indentation.
Second:
Replace line 652(it should be blank) with “watts = float(self.batt_rate) / 1000″
Make sure the indentation matches the lines above and below it.
Save, exit any guidance power managers you have running, and start guidance-power-manager (type that on the command line)
Unplug your laptop, and wait a couple minutes. Then hover your mouse over the battery symbol in the panel it should show the number of watts you are using.
If you don’t have Kubuntu, or you want more real-time updates to the wattage (guidance only updates 2 a minute or so) you can download a python script that I wrote here .

October 26, 2007 at 1:30 pm
Thank you, works like a charm.