Version: unspecified (using KDE 4.7.3)
The battery monitor in the KDE system tray does not indicate remaining battery time any more but only the percentage of power which is left. No settings are available in the Battery Monitor Settings to get back this precious information.
Turning back power profiles to defaults has not changed anything.
I added the enclosed archive containing snapshots of the battery monitor and the Muon Package Manager update history showing recent significant updates which may have altered the system tray configuration.
Steps to Reproduce:
Loads without specific action.
Shows only the remaining power in percentage.
Display remaining battery time.
OS: Linux (i686) release 3.0.0-14-generic
Please explain better. IN KDE 4.8 when I click on the battery applet it indicates Remaining time (if AC is not plugged).
Exact string is "Time Remaining:"
Created attachment 67442 [details]
Snapshots of recent updates and desktop with battery monitor displayed
(In reply to comment #1)
> Please explain better. IN KDE 4.8 when I click on the battery applet it
> indicates Remaining time (if AC is not plugged).
I am under KDE 4.7.3 and when I click on the applet it indicates : "Battery: XX% (discharging) -AC adapter: Not plugged in."
Please have a look at my pdf attachment on page #8.
Created attachment 67452 [details]
KDE 4.8 battery applet on click
Time Remaining is present
Created attachment 67453 [details]
Snapshot on the applet
Time remaining not present any more when clicking on the applet (KDE 4.7.3)
What was your previous KDE version where it works? (before your update)
As I showed on the screenshot, it works on4.8 RC2.
(In reply to comment #7)
> What was your previous KDE version where it works? (before your update)
> As I showed on the screenshot, it works on4.8 RC2.
I suppose the problem occurred when I updated my system to KDE 4.7.3. but I have no certainty as I noticed it only today. As shown on the first attachment, the update I am thinking of was performed on 22nd December 2011. I presume the previous version where it worked was the 4.7.2.
Is the version you are talking about already available for the Kubuntu 11.10 distribution?
So actually you mean in the tooltip? Not when you click on the applet? The tooltip appears on mouve over the applet, no click involved. A tooltip is a short information only.
(In reply to comment #9)
> So actually you mean in the tooltip? Not when you click on the applet? The
> tooltip appears on mouve over the applet, no click involved. A tooltip is a
> short information only.
The information is missing when I do click on the applet as shown in attachment #3 [details] (Snapshot on the applet) in which you will notice the difference between our two screenshots. It has never been present in the tooltip.
Ah I did not notice it was my screenshot besides yours...
Well it works for me as you can see and I can't say much more except that maybe your upgrade misses something. Try asking your distribution forum. What's your distribution so I can ask around if it works for other people?
(In reply to comment #11)
> Ah I did not notice it was my screenshot besides yours...
> Well it works for me as you can see and I can't say much more except that maybe
> your upgrade misses something. Try asking your distribution forum. What's your
> distribution so I can ask around if it works for other people?
Ok... I run Kubuntu 11.10 Oneiric Ocelot. I will wait until the next KDE upgrade is available for it, maybe it will fix the problem. I want to thank you anyway for your time and help. It has been only a few months I changed over from Windows to Linux and I had to use the KDE bug report twice with an outstanding support from your side at KDE !
Other KDE developers decided years ago that remaining time was useless and default to no remaining time on the battery widget. You have to edit ~/.kde/share/config/plasma-desktop-appletsrc to configure the battery widget to show the remaining time, there is not graphical tool for that (also decided by the other developers). Unfortunately the configuration I used to use stopped working in 4.5 or so, I thought someone had completely removed the support for showing the remaining time. I will try to make it work here.
And before anyone start to complain I was one of those that tried to convince the others that remaining time is usefull.
To activate the remaining time setting do the following: activate the "Show the state for each battery present" option in the battery plasmoid, click on the "Ok" button and then edit ~/.kde/share/config/plasma-desktop-appletsrc. Search for the string showMultipleBatteries and add the line below after that line:
now you need to restart kded4 or logout and login.
Here the plasmoid take some time to start showing the remaining time. I looked at the source code and the string for remaining time is hidden if the value is zero and the value is set to zero initially, it is changed only when the battery changes to the charging or discharging state. I think PowerDevil or UPower is being a bit slow to detect the battery changed state.
(In reply to comment #14)
> To activate the remaining time setting do the following: activate the "Show the
> state for each battery present" option in the battery plasmoid, click on the
> "Ok" button and then edit ~/.kde/share/config/plasma-desktop-appletsrc. Search
> for the string showMultipleBatteries and add the line below after that line:
> now you need to restart kded4 or logout and login.
> Here the plasmoid take some time to start showing the remaining time. I looked
> at the source code and the string for remaining time is hidden if the value is
> zero and the value is set to zero initially, it is changed only when the
> battery changes to the charging or discharging state. I think PowerDevil or
> UPower is being a bit slow to detect the battery changed state.
This tip seems to be a good step towards a solution... Forgive me but I am a fresh and new Linux user and so, a lovely ignorant in command lines... Could you tell if I have to copy/paste the line into the Terminal or should I go through a different way. I already tried to copy and run the command as you wrote it: "~/.kde/share/config/plasma-desktop-appletsrc" with no success as I got this result: "thomas@thomas-Inspiron-2200:~$ ~/.kde/share/config/plasma-desktop-appletsrc
bash: /home/thomas/.kde/share/config/plasma-desktop-appletsrc: Permission denied"...
Copy the file ~/.kde/share/config/plasma-desktop-appletsrc to a temporary place (your home directory for examplo). You can use this command for that:
cp ~/.kde/share/config/plasma-desktop-appletsrc ~/
Use the command below to edit the file:
Then go to the menu option "Edit" -> "Find", type showMultipleBatteries. After the line found type:
The end result should look like this:
Then copy the file to the original location:
cp -f ~/plasma-desktop-appletsrc ~/.kde/share/config/plasma-desktop-appletsrc
Created attachment 67515 [details]
I followed your indications. All went well, I restarted my system but no change happened whereas the plasma-dektop-appletsrc file contains the lines I added. I attached a screenshot of how my file looks and the applet itself which is unchanged...
Have checked if the string showMultipleBatteries appear ony once in plasma-desktop-appletsrc? It is possible it can appear more than once and you edited the wrong place.
If it appears only once then probably the battery data engine is not updating the remaining, in that case the plasmoid will hide the "Time remaining: " line as I said in comment #14. You can test the battery data engine using plasmaengineexplorer. Launch it and select powermanagement in the "Data engines" combo box, then expand the "Battery" entry, and check the value of "Remaining msec", if it is zero then that explains why the "Time remaining: " does not appear.
Send me the outpout of the command below when the problem happens:
If upower reports the correct time remaining then there is a problem in the battery data engine or it is being very slow to update the battery's status. Can you wait a couple of minutes, launch plasmaengineexplorer as I described above and check the "Remaining msec" value again?
Created attachment 67517 [details]
Plasma engine screenshot
This is what I get when I run the plasma engine. As you can see, there is no such "Remaining msec" as expected...
And here is the result of the updevil dump :
thomas@thomas-Inspiron-2200:~$ upower --dump
power supply: yes
updated: Fri Jan 6 17:32:34 2012 (2550 seconds ago)
has history: no
has statistics: no
power supply: yes
updated: Fri Jan 6 18:14:43 2012 (21 seconds ago)
has history: yes
has statistics: yes
energy: 44.8884 Wh
energy-empty: 0 Wh
energy-full: 71.7948 Wh
energy-full-design: 65.12 Wh
energy-rate: 17.1236 W
voltage: 14.993 V
time to empty: 2.6 hours
1325870083 62.523 discharging
1325870053 62.729 discharging
1325870023 62.935 discharging
1325869993 63.100 discharging
1325870083 17.124 discharging
1325870053 18.234 discharging
1325870023 17.124 discharging
1325869993 22.703 discharging
There is something wrong in the powermanagement dataengine then.
(In reply to comment #20)
> There is something wrong in the powermanagement dataengine then.
Am I able to change something about it as a user?
probably not. My battery plasmoid is working now, it shows the remaining time right after I disconnect from power, both for my notebook's battery and UPS. I have no ideia what could be causing this problem yet.
Let's try a radical test (restart the desktop). Execute:
then press Alt+F2, type plasma-desktop, press ENTER, then check if it shows the remaining time.
Well, this did not succeed either... As you can imagine I can not think of any other solution at my level.
Can I count on this bug being followed at KDE in order to see if others experience the same situation?
And by the way, is it naive to believe that a coming KDE update for Kubuntu 11.10 will reset the prior situation in which I had the time remaining indicated in the plasmoid?
(In reply to comment #23)
> Well, this did not succeed either... As you can imagine I can not think of any
> other solution at my level.
It was just a test, which showed something really wierd in your computer. I wanted to test if the problem happens only when the plasmoid receive events from upower or also when the plasmoid retrieves the battery status, which is what it does during initialization (like in the test). Since it also did not show the remaining time then retrieving battery's remaining time is not working. That is strange because 'upower --dump' shows the remaining time.
> Can I count on this bug being followed at KDE in order to see if others
> experience the same situation?
What do you mean?
> And by the way, is it naive to believe that a coming KDE update for Kubuntu
> 11.10 will reset the prior situation in which I had the time remaining
> indicated in the plasmoid?
I do not think anybody at Kubuntu will try to solve this problem :-/
Another test: send me the output of the command when on battery:
qdbus org.kde.Solid.PowerManagement \
(In reply to comment #25)
> Another test: send me the output of the command when on battery:
> qdbus org.kde.Solid.PowerManagement \
> /org/kde/Solid/PowerManagement \
Here is what I get:
thomas@thomas-Inspiron-2200:~$ qdbus org.kde.Solid.PowerManagement \
> /org/kde/Solid/PowerManagement \
Ok, so the upower backend is not working properly since it is reporting zero instead of the real value. We are getting closer to where the problem is.
Just to make sure, you do not have hal installed, right? Hal is the older backend Solid used to use to manage batteries. I just want to make sure you do not have both hal and upower installed since they can conflict with each other. I do not know which name Kubuntu uses for the hal package, you probably can use the usual Kubuntu upgrade software to search for the string "hal" and see what it returns. If it returns nothing then it is Ok.
Created attachment 67549 [details]
plasma_engine_powermanagement.so with extra debug messages
I guess your Kubuntu is compiled for 64-bit, right? If so I want you to test the attached plasma_engine_powermanagement.so. It will print some extra debug messages that can help me figure out why the remainig time does not work in yor system.
Do the following as root, you can use 'sudo su' command to become root:
. locate your current plasma_engine_powermanagement.so. You can do that using the following command:
OLD_ENGINE=$(kde4-config --path lib --locate \
. backup your current plasma_engine_powermanagement.so:
cp $OLD_ENGINE /root
. install the attached file:
cp -f plasma_engine_powermanagement.so $OLD_ENGINE
The following steps you can do as a normal user (not root):
. run kdebugdialog, search for the string "solid-powermanagement". Check the checkbox that appear. Search now for the string "plasmaengineexplorer", check it and click on Ok button.
. run plasmaengineexplorer like this:
plasmaengineexplorer &> log.txt
. in plasmaenginexplorer select the "powermanagement" data engine, close plasmaengineexplorer and send me the file log.txt.
(In reply to comment #28)
I run a 32bit version, will it work however?
(In reply to comment #29)
> (In reply to comment #28)
> I run a 32bit version, will it work however?
No, it will not :-(
(In reply to comment #30)
Never mind... I will get used to it I guess. Thank you for you time and help! It's been only a few months joined the Linux community; I would have waited a big deal more than that to get such help from Microsoft...
I think I may have found the cause of this problem. The explanation is technical, there is no other way to explain it.
The type qulonglong is used to store the remaining time, but it looks like it is being typedef'ed to int instead of 'unsigned long long'. Because of this mismatch the dbus calls and signals are not working.
I will add some debug messages to the powermanagementengine to warn people when the calls do not work.
Git commit 23a67ef1ef81b75ba6e427f31920cf30a366e665 by Lamarque V. Souza.
Committed on 08/01/2012 at 03:54.
Pushed by lvsouza into branch 'KDE/4.8'.
Print DBus error message if battery remaining time call fails.
(cherry picked from commit 9d7caa1f620c2b6af2ed8951738bc43bf3fe6341)
M +3 -1 plasma/generic/dataengines/powermanagement/powermanagementengine.cpp
When the error happens this message will appear in the log:
"Unexpected reply signature: got "t", expected "i""
t means 'unsigned long long'
i means int
(In reply to comment #34)
Ok, what do you want me to do with this?
Upgrade to the latest commit in KDE/4.8 branch, test using plasmaengineexplorer and see if any error messages is printed in method PowermanagementEngine::batteryRemainingTimeReply.
If you are not used to compile KDE SC yourself then you will need to wait until Kubuntu provides newer packages for it. KDE SC 4.8 final is going to include this change, so you can wait until there to do the test.
Hi, can you test if this problem still happens in 4.8.0? If yes, can you send me the file ~/.xsession-errors?
(In reply to comment #37)
> Hi, can you test if this problem still happens in 4.8.0? If yes, can you send
> me the file ~/.xsession-errors?
No! Every thing is fine now after I updated Kubuntu on KDE 4.7.4! Thank you for your efforts!
Closing as it works for you now, thanks for your follow-up!
Using KDE 4.10.5 under Kubuntu and the same problem here. Here is the output of 'upower':
volkan@ubuntu:~$ upower --show-info /org/freedesktop/UPower/devices/battery_BAT1
power supply: yes
updated: Thu Aug 1 21:32:20 2013 (27 seconds ago)
has history: yes
has statistics: yes
energy: 1.248 Wh
energy-empty: 0 Wh
energy-full: 4.4 Wh
energy-full-design: 0.001 Wh
energy-rate: 0.835 W
voltage: 10.636 V
time to empty: 1.5 hours
1375385540 28.364 discharging
1375385540 0.835 discharging
1375385510 1.051 discharging
1375385480 1.338 discharging
See Comment 14. It's been turned into a hidden config option that is still the same with the rewritten battery monitor in 4.11.
Why is it still not enabled by default? Comment 13 tells that this would be added again.
I Agree that at least an estimation of remaining time is something really useful. My votes go for this one.
KDE 4.11.3, Kubuntu 13.10. The battery monitor shows only percentage, no time. I have this in my settings file:
I don't remember editing the file, so this must be default. However there is also no way to tell if this is the correct applet, because of the cryptic heading. The only thing that points to the correct applet is the string battery.
still not showing time remaining in the latest KDE
FYI: There is an "Enhanced Battery Monitor" plasmoid...basically the old one, but it shows the remaining time.
Panel settings -> Add Widgets... -> Get new Widgets -> search for 'Enhanced Battery Monitor'.
You can use that one until this one is usable again.
Git commit fc3da7a59effbacbd1c21af5d011a8354040b1ca by Kai Uwe Broulik.
Committed on 15/06/2014 at 13:12.
Pushed by broulik into branch 'master'.
Always show battery remaining time
I am really tired of this topic. Yes, the battery remaining time is not that accurate and
jumps around (the latter is something that could be fixed using a moving average). But if
we jump onto that train we would also need to remove the battery percentage itself as it's not
accurate either. 30% on a dead battery can quickly become 5% and then the notebook suddenly
turns off. "Battery: Present".
The remaining time is in the battery's tooltip, many distributions have even patched the
battery monitor to show the time by default, there's even a clone of the original battery
monitor on GHNS just with that option enabled; every other desktop environment even emphasizes
the remaining time, Windows prefers the time over percentage, Mac OS X allows you to put
the remaining time in the panel rather than the percentage, etc etc.
As a maintainer I now made the decision to show remaining time by default - it's no
"in your face" display but in the battery's detail section - and I would kindly
ask all the people involved in this discussion to respect this. Thank you!
D +0 -14 applets/batterymonitor/contents/config/main.xml
M +0 -1 applets/batterymonitor/contents/ui/PopupDialog.qml
M +0 -1 applets/batterymonitor/contents/ui/batterymonitor.qml
Sorry to crush your hopes, but this is Plasma 5 stuff :-)
(In reply to comment #47)
> Git commit fc3da7a59effbacbd1c21af5d011a8354040b1ca by Kai Uwe Broulik.
> Committed on 15/06/2014 at 13:12.
> Pushed by broulik into branch 'master'.
> Always show battery remaining time
> I am really tired of this topic. Yes, the battery remaining time is not that
> accurate and
> jumps around (the latter is something that could be fixed using a moving
> average). But if
> we jump onto that train we would also need to remove the battery percentage
> itself as it's not
> accurate either. 30% on a dead battery can quickly become 5% and then the
> notebook suddenly
> turns off. "Battery: Present".
> The remaining time is in the battery's tooltip, many distributions have even
> patched the
> battery monitor to show the time by default, there's even a clone of the
> original battery
> monitor on GHNS just with that option enabled; every other desktop
> environment even emphasizes
> the remaining time, Windows prefers the time over percentage, Mac OS X
> allows you to put
> the remaining time in the panel rather than the percentage, etc etc.
> As a maintainer I now made the decision to show remaining time by default -
> it's no
> "in your face" display but in the battery's detail section - and I would
> ask all the people involved in this discussion to respect this. Thank you!
> D +0 -14 applets/batterymonitor/contents/config/main.xml
> M +0 -1 applets/batterymonitor/contents/ui/PopupDialog.qml
> M +0 -1 applets/batterymonitor/contents/ui/batterymonitor.qml
Thanks a lot! You are a good man!
Waiting for this feature in Plasma 5.