xexpanderx / Conky-themes

Conky themes
52 stars 19 forks source link

[Conky revisited 2] CPU stats aren't working #7

Closed devqueue closed 3 years ago

devqueue commented 3 years ago

I am using conky on Kali Linux. It's working fine but the CPU stat shows 0% all the time even under heavy load. Earlier the battery percentage wasn't working but I opened the settings.lua file changed BAT0 to BAT1 and it worked fine. But I can't find anything as such for the CPU stat. Also, I noticed CPU_NUMBER was set to 4 and I have 8 cores, Will the hard coded value be a problem?

xexpanderx commented 3 years ago

It is weird it shows 0%, but yes, you should change cpu_number to 8.

Which CPU do you have btw?

devqueue commented 3 years ago

Yes I did but there was no change. I still see the cpu percentage as 0% I have a ryzen 7 5700u. Running on a Lenovo flex 5. Is there anything I can change in the draw_cpu function. In not really familiar with Lua but I assume anything I change has to be in the conky_parse()

conky_parse('${cpu cpu' .. tostring(i) .. '}'))

Or maybe here

cairo_show_text(cr, conky_parse('${cpu cpu0}' .. "%"))

Can you please suggest something?

devqueue commented 3 years ago

Here's a screenshot that might illustrate the issue

Screenshot_2021-08-31_11-53-46

xexpanderx commented 3 years ago

Hey, can you try using a "normal" config file for conky, try with the cpu cpu0? Do you get anything?

Some questions:

Again, try with a very simple conky showing only CPU.

devqueue commented 3 years ago

1. Conky version

conky 1.11.6 compiled 2020-08-17 for Linux x86_64

I'm running Kali-Linux on wsl2 using XRDP remote desktop for the GUI

xexpanderx commented 3 years ago

Sounds like this is a Conky issue, not a configuration issue. Please contact Conky developers.

Closing this.

devqueue commented 3 years ago

okay thanks

elightcap commented 2 years ago

@devqueue did you ever find a solution to this? im running into the same issue

devqueue commented 2 years ago

No i couldn't I just ended up removing the cpu and ram stat lines from the config.

abraham-lincoln-okaalo commented 2 years ago

Sounds like this is a Conky issue, not a configuration issue. Please contact Conky developers.

Closing this.

I doubt that this is an issue with Conky. Conky Circle Horizontal and Conky Circle Vertical display the CPU Total Usage well. Conky Square Horizontal and Conky Square Vertical do not display the CPU total usage. [product: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz] [Kali GNU/Linux Rolling(2021.4)] These work well on Arch though. Still troubleshooting.

xexpanderx commented 2 years ago

Ok, interesting. Can you try change line 316 in "settings.lua" for Conky Square Horizontal to this: cairo_show_text(cr, conky_parse('${cpu cpu0}') .. "%")

Will that make any difference?

abraham-lincoln-okaalo commented 2 years ago

Ok, interesting. Can you try change line 316 in "settings.lua" for Conky Square Horizontal to this: cairo_show_text(cr, conky_parse('${cpu cpu0}') .. "%")

Will that make any difference?

Thanks for the qr. Tried this, unfortunately, there's no change.

xexpanderx commented 2 years ago

Still showing "0"? Then it does not make sense, since it is a very basic command and should work. This looks like Conky issue to me.

Does ${cpu cpu0} work in a normal conky configuration?

abraham-lincoln-okaalo commented 2 years ago

Still showing "0"? Then it does not make sense, since it is a very basic command and should work. This looks like Conky issue to me.

Does ${cpu cpu0} work in a normal conky configuration?

Okay. Hopefully I can get around that. Yes it does.

TanawatJukmongkol commented 2 years ago

This is what I worked out (I have the same issue): Basically, it doesn't update the cpu info to save on battery. You have to execute ${cpu cpu0} in the conky.text = [[]] first, then conky_parse('${cpu cpu0}') will start working, though it will look ugly. They should add a method / expose the variable that prevent updating the CPU stats somewhere to allow reading and updating the CPU stats.