It looks like default TeeJeeTech CPU Panel widgets have bad code [SOLVED]

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
User avatar
Logansfury
Level 8
Level 8
Posts: 2434
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

It looks like default TeeJeeTech CPU Panel widgets have bad code [SOLVED]

Post by Logansfury »

Hello everyone,

On my laptop I performed an nproc in terminal and got a return of 8 cores for my CPU, so I enabled the default widget that comes with CM2, TeeJeeTech CPU Panel (8-core)

all 8 graphs on the display are active, but I note that the frequency monitor for all 8 cores is identical all the time. I checked the code and its seems to be trying to call separate data:

Code: Select all

conky.text = [[
${color2}CPU ${color0} ${cpu cpu0}%  ${color3}${cpubar cpu0 10,} 
${cpugraph cpu0 100,400}${voffset -19}
${cpugraph cpu1 50,100}${cpugraph cpu2 50,100}${cpugraph cpu3 50,100}${cpugraph cpu4 50,100}${voffset -19}
${cpugraph cpu5 50,100}${cpugraph cpu6 50,100}${cpugraph cpu7 50,100}${cpugraph cpu8 50,100}
${font Ubuntu:size=10}${voffset -110}${color3}${goto 10}1 ${goto 110}2 ${goto 210}3 ${goto 0} ${goto 310}4 ${voffset 50}${goto 10}5 ${goto 110}6 ${goto 210}7 ${goto 310}8
${font Ubuntu:size=8}${voffset -67}${color3}${goto 58}${freq_g (1)}GHz ${goto 158}${freq_g (2)}GHz ${goto 258}${freq_g (3)}GHz ${goto 0} ${goto 358}${freq_g (4)}GHz ${voffset 50}${goto 58}${freq_g (5)}GHz ${goto 158}${freq_g (6)}GHz ${goto 258}${freq_g (7)}GHz ${goto 358}${freq_g (8)}GHz
]];
despite the differences in the code however, I got 8 identical values every refresh. I asked the chatgpt bot about CPU info and it introduced me to cpufrequtils (sudo apt install cpufrequtils) and the command cpufreq-info -c 1 | grep 'current CPU frequency' | awk '{print $5}'

Using this utility, I was able to get accurate values for each core:

Code: Select all

logansfury@OptiPlex-5040:~$ { cpufreq-info -c 0 | grep 'current CPU frequency'; cpufreq-info -c 1 | grep 'current CPU frequency'; cpufreq-info -c 2 | grep 'current CPU frequency'; cpufreq-info -c 3 | grep 'current CPU frequency';} | awk '{print $5}'
1.94
2.22
2.20
2.58
logansfury@OptiPlex-5040:~$ 
Using this as a template, I made my own edit of the CPU Panel (8-core) widget:

Code: Select all

conky.text = [[
${color2}CPU ${color0} ${cpu cpu0}%  ${color3}${cpubar cpu0 10,}
${cpugraph cpu0 50,400}${voffset -19}
${cpugraph cpu1 50,100}${cpugraph cpu2 50,100}${cpugraph cpu3 50,100}${cpugraph cpu4 50,100}${voffset -19}
${cpugraph cpu5 50,100}${cpugraph cpu6 50,100}${cpugraph cpu7 50,100}${cpugraph cpu8 50,100}
${font FuraCode Nerd Font:size=10}${voffset -110}${color3}${goto 10}1 ${goto 110}2 ${goto 210}3 ${goto 0} ${goto 310}4 ${voffset 50}${goto 10}5 ${goto 110}6 ${goto 210}7 ${goto 310}8
${font FuraCode Nerd Font:size=8}${voffset -67}${color3}${goto 58}${exec cpufreq-info -c 0 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${goto 158}${exec cpufreq-info -c 1 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${goto 258}${exec cpufreq-info -c 2 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${goto 0} ${goto 358}${exec cpufreq-info -c 3 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${voffset 50}${goto 58}${exec cpufreq-info -c 4 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${goto 158}${exec cpufreq-info -c 5 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${goto 258}${exec cpufreq-info -c 6 | grep 'current CPU frequency' | awk '{print $5}'}GHz ${goto 358}${exec cpufreq-info -c 7 | grep 'current CPU frequency' | awk '{print $5}'
}GHz
]];
after edits I repositioned it under the Mainte minimalis and it looks like it was always a part of the widget:

Image
Last edited by Logansfury on Thu May 16, 2024 8:36 am, edited 2 times in total.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2963
Joined: Wed Oct 19, 2016 6:08 pm

Re: It looks like default TeeJeeTech CPU Panel widgets have bad code

Post by zcot »

Code: Select all

${font Ubuntu:size=8}${voffset -67}${color3}${goto 58}${freq_g (1)}GHz ${goto 158}${freq_g (2)}GHz ${goto 258}${freq_g (3)}GHz ${goto 0} ${goto 358}${freq_g (4)}GHz ${voffset 50}${goto 58}${freq_g (5)}GHz ${goto 158}${freq_g (6)}GHz ${goto 258}${freq_g (7)}GHz ${goto 358}${freq_g (8)}GHz
it should not look like that: ${freq_g (1)}
but should be that instead: ${freq_g 1}
User avatar
Logansfury
Level 8
Level 8
Posts: 2434
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: It looks like default TeeJeeTech CPU Panel widgets have bad code

Post by Logansfury »

zcot wrote: Thu May 16, 2024 7:53 am

Code: Select all

${font Ubuntu:size=8}${voffset -67}${color3}${goto 58}${freq_g (1)}GHz ${goto 158}${freq_g (2)}GHz ${goto 258}${freq_g (3)}GHz ${goto 0} ${goto 358}${freq_g (4)}GHz ${voffset 50}${goto 58}${freq_g (5)}GHz ${goto 158}${freq_g (6)}GHz ${goto 258}${freq_g (7)}GHz ${goto 358}${freq_g (8)}GHz
it should not look like that: ${freq_g (1)}
but should be that instead: ${freq_g 1}
Thank you for the fix! I just made this edit on the 4-core widget and the numbers are different between cores now.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”