haideralipunjabi / polybar-kdeconnect

KDEConnect module for Polybar
https://blog.haideralipunjabi.com/posts/making-modules-for-polybar-shell-python/
165 stars 11 forks source link

High CPU usage #20

Closed naib864 closed 3 years ago

naib864 commented 3 years ago

When activating this module, I get an idle cpu usage of 30% on all cores. Not sure why, only thing I'm sure of is that this module is the reason. Would love to find out why, but don't know where and how to look.

EDIT: Happens on both of my Computers, both running Regolith Linux (basically Ubuntu 20.04).

haideralipunjabi commented 3 years ago

I will look into it. Meanwhile, what happens if you just use KDEConnect and not my module?

naib864 commented 3 years ago

KDEConnect itself runs smoothly as far as I can see. I don't use tray icons in my polybar, so it's just running in the background without it's icon.

haideralipunjabi commented 3 years ago

I still can't figure out the issue. The only thing I can recommend is removing tail=true from the module configuration. The tail=true config executes the script in an infinite loop. Without it, it should refresh every 5 seconds. You can change the refresh interval using the interval config.

Read More

naib864 commented 3 years ago

Thanks, will try that. Interesting thing: I only get the High CPU usage on Ubuntu. On Arcolinux CPU usage is fine. But I get an error that it doesn't find the module org.kde.kdeconnect.device.battery. Probably an issue with kdeconnect rather than this module, though.

haideralipunjabi commented 3 years ago

The couldn't find the module is a new issue due to an update to kdeconnect. I have fixed it yesterday. Use the latest code and it should work fine.

naib864 commented 3 years ago

Thanks, both things suggested worked, whole script works as intended now :)
tail=false and interval=1 brings idle cpu usage back to normal.