mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 07:15:19 +01:00
[GH-ISSUE #129] Not able to get the intel CPU temp #5692
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#5692
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bluebyt on GitHub (Apr 28, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/129
I am not able to find the right label for the intel CPU temperature.

Bases on your example, I google the label and this is an AMD CPU.
{temp_c:k10temp_Tccd1}
I tried to do the same thing with my intel CPU.
$sensors coretemp-isa-0000
Here all labels I tried:
{temp_c:coretemp_Package id 0}
{temp_c:coretemp-isa-0000_Package id 0}
I always see the label itsef in the bar instead of the temperature value:

sensors
https://pastebin.com/xyq2692g
@JakeStanger commented on GitHub (Apr 29, 2023):
This is an area I need to improve and I'm surprised it's not come up sooner tbh. I aim to add a command to the CLI when I eventually get round to that which will dump the sensor names to make this a bit easier.
The
sysinfolibrary under the hood uses a few different formats for naming the sensors depending on what is available:github.com/GuillaumeGomez/sysinfo@a21fd2a5bd/src/linux/component.rs (L285-L292)Ironbar then replaces any spaces in the label with a
-(which should probably be an_, or arguably doesn't need to happen at all, so I might have to address that in the future):github.com/JakeStanger/ironbar@e5bc44168f/src/modules/sysinfo.rs (L291)I think based off that, if you try replacing the spaces with
-hyphens, you should be along the right lines.@bluebyt commented on GitHub (Apr 29, 2023):
Thank you for your help!
I tried these commands:
{temp_c:coretemp-isa-0000_Package-id-0}
{temp_c:coretemp_Package-id-0}
But that doesn't wok either.
$sensors:
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +45.0°C (high = +84.0°C, crit = +100.0°C)
@JakeStanger commented on GitHub (Apr 29, 2023):
Darn okay. If you're happy to dive into the code, you could add a
println!here to log all the keys:github.com/JakeStanger/ironbar@e5bc44168f/src/modules/sysinfo.rs (L291-L295)If not, I need to get Ironbar running on my (Intel) laptop to look at another issue and I can test it then. Hopefully (?) that should match yours. If it does I can probably stick the common values on the wiki to make it a bit easier.
@bluebyt commented on GitHub (Apr 30, 2023):
Ok, I will try!
@bluebyt commented on GitHub (May 3, 2023):
I add these line, but it doesn't output anything.
@howardcoldham commented on GitHub (May 5, 2023):
The way I got this working for my cpu was reading how sysinfo did it then digging through the various /sys/class/hwmon/hwmonX/name and /sys/class/hwmon/hwmonX/tempY_label until I found the right combo then putting a - between them.
@JakeStanger it could be fairly trivial to automate/default this for regular AMD and Intel CPUs by looping through the folders above and looking for k10temp or coretemp in the name files and building the string up from there.
@bluebyt commented on GitHub (May 6, 2023):
I found the name and label, but still not working:
{temp_c:coretemp_Package-id-0}°C
$cat /sys/class/hwmon/hwmon4/name
coretemp
$cat /sys/class/hwmon/hwmon4/temp1_label
Package id 0
$cat /sys/class/hwmon/hwmon4/temp1_input
43000
@JakeStanger commented on GitHub (May 7, 2023):
@bluebyt I've just got round to testing this myself on my Intel laptop, and
{temp_c:coretemp_Package-id-0}°Cdoes work as expected for me. Could you share your config please?@howardcoldham this makes sense, especially since the names seem to be pretty static for Intel/AMD and the package I'm using already gives me the list. I can probably come up with some aliases (maybe something like
temp_c:cputhat then looks for the right value.@bluebyt commented on GitHub (May 7, 2023):
@JakeStanger
Here you go!
https://pastebin.com/2bD8z17m
@JakeStanger commented on GitHub (May 7, 2023):
Aha - it should be
coretemp-Package-id-0with a hyphen, rather than an underscore beforePackage.I've just added a sentence to the wiki with the typical Intel & AMD names as a stopgap for now.
@bluebyt commented on GitHub (May 7, 2023):
Yes its working, thank you!
I followed the wiki for this part
{temp_c:k10temp_Tccd1}
@JakeStanger commented on GitHub (May 7, 2023):
Awesome, thanks for confirming. I'll close this issue now and open a new one to track the automatic alias idea.