Giter VIP home page Giter VIP logo

Comments (7)

martinalex000 avatar martinalex000 commented on August 15, 2024

On my T460s the widget works perfectly fine if the laptop is running on the first battery. When switching to the second battery, the indicator still checks the first battery and reports 0.0 W. It would be great if the power consumption on all available batteries could be summed up before displaying.
And thanks a lot for this super simple, but very helpful widget!

from plasma-power-monitor.

j4nm4c avatar j4nm4c commented on August 15, 2024

Solved this on my ThinkPad by editing the main.qml file to display the sum of BAT0 and BAT1. Not the best way but... it just works. (you can easily change the BATx numbers if it differs for you).
Edited file: main.zip
It should be enough to replace the main.qml file in ~/.local/share/plasma/plasmoids/org.kde.powerMonitor/contents/ui/
and run killall plasmashell; kstart5 plasmashellto refresh the widget files.

from plasma-power-monitor.

atul-g avatar atul-g commented on August 15, 2024

@Tarballwalf @martinalex000 @j4nm4c - sorry for the delayed response! Was unable to find time due to college/job : D

@Tarballwalf & @martinalex000 - could you please share me the output of the following commands:

  • ls /sys/class/power_supply
  • cat /sys/class/power_supply/BAT[num]/present for each battery [num] present in laptop

Additionally, @Tarballwalf could you also share me the output of this command:

  • cat /sys/class/power_supply/BAT[num]/power_now

Currently, in code, I did ensure to check if the power_now file exists and use that to fetch the power usage, so I'm not sure why it doesn't show anything in your case (by "doesn't show the wattage at all", did you mean it shows "0.0 W"?)

One of the main hurdles of developing this widget has been that my laptop was the only device I had for reference, coding and testing and therefore I could not take into account laptops with dual batteries or different files provided by kernel for reporting battery power consumption (like power_now). So, thanks a lot for reporting these issues here!

from plasma-power-monitor.

Tarballwalf avatar Tarballwalf commented on August 15, 2024

image

Regarding the second question,
image

The plugin works, but only when BAT0 is actively in use. If BAT1 is used, it will just report as 0.

from plasma-power-monitor.

atul-g avatar atul-g commented on August 15, 2024

Thanks @Tarballwalf !

I have released v0.2 and it should be able to support dual batteries. I have not been able to test them as I don't have a laptop with dual batteries. Would request you to try out the new version and let me know if you face any regressions or if the widget still doesn't work!

from plasma-power-monitor.

j4nm4c avatar j4nm4c commented on August 15, 2024

Everything works fine for me
(this is my setup):

ls /sys/class/power_supply/ | grep BAT
BAT0
BAT1
                                                                                                                                                                       
cat /sys/class/power_supply/BAT*/power_now
0
9454000

from plasma-power-monitor.

atul-g avatar atul-g commented on August 15, 2024

Thank you for confirming @j4nm4c ! Closing this issue in that case.

from plasma-power-monitor.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.