[GH-ISSUE #129] Not able to get the intel CPU temp #1474

Closed
opened 2026-05-22 22:52:33 +01:00 by JakeStanger · 12 comments
Owner

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}
slurped

I tried to do the same thing with my intel CPU.
$sensors coretemp-isa-0000

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +45.0°C  (high = +84.0°C, crit = +100.0°C)
Core 0:        +42.0°C  (high = +84.0°C, crit = +100.0°C)
Core 1:        +41.0°C  (high = +84.0°C, crit = +100.0°C)
Core 2:        +45.0°C  (high = +84.0°C, crit = +100.0°C)
Core 3:        +40.0°C  (high = +84.0°C, crit = +100.0°C)
Core 4:        +42.0°C  (high = +84.0°C, crit = +100.0°C)
Core 5:        +42.0°C  (high = +84.0°C, crit = +100.0°C)

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:
slurped

sensors
https://pastebin.com/xyq2692g

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} ![slurped](https://user-images.githubusercontent.com/18442224/235263248-46deae57-72b9-4612-8517-d1758ccd188c.png) I tried to do the same thing with my intel CPU. $sensors coretemp-isa-0000 ``` coretemp-isa-0000 Adapter: ISA adapter Package id 0: +45.0°C (high = +84.0°C, crit = +100.0°C) Core 0: +42.0°C (high = +84.0°C, crit = +100.0°C) Core 1: +41.0°C (high = +84.0°C, crit = +100.0°C) Core 2: +45.0°C (high = +84.0°C, crit = +100.0°C) Core 3: +40.0°C (high = +84.0°C, crit = +100.0°C) Core 4: +42.0°C (high = +84.0°C, crit = +100.0°C) Core 5: +42.0°C (high = +84.0°C, crit = +100.0°C) ``` 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: ![slurped](https://user-images.githubusercontent.com/18442224/235262827-81c181d1-cfc2-4cb8-a7e1-9ba42d65eeec.png) sensors https://pastebin.com/xyq2692g
JakeStanger 2026-05-22 22:52:33 +01:00
Author
Owner

@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 sysinfo library 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.

<!-- gh-comment-id:1528767273 --> @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 `sysinfo` library under the hood uses a few different formats for naming the sensors depending on what is available: https://github.com/GuillaumeGomez/sysinfo/blob/a21fd2a5bd62b70d2f3ffb15ff5b343eeee2049a/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): https://github.com/JakeStanger/ironbar/blob/e5bc44168f29374dab6e15fa049627a10df14f3a/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.
Author
Owner

@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)

<!-- gh-comment-id:1528800272 --> @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)
Author
Owner

@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.

<!-- gh-comment-id:1528874497 --> @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: https://github.com/JakeStanger/ironbar/blob/e5bc44168f29374dab6e15fa049627a10df14f3a/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.
Author
Owner

@bluebyt commented on GitHub (Apr 30, 2023):

Ok, I will try!

<!-- gh-comment-id:1528984987 --> @bluebyt commented on GitHub (Apr 30, 2023): Ok, I will try!
Author
Owner

@bluebyt commented on GitHub (May 3, 2023):

I add these line, but it doesn't output anything.

        let key = component.label().replace(' ', "-");
        let temp = component.temperature();

        format_info.insert(format!("temp_c:{key}"), format!("{temp:.0}"));
        format_info.insert(format!("temp_f:{key}"), format!("{:.0}", c_to_f(temp)));
                
       // Log all keys in format_info
for key in format_info.keys() {
    println!("Format info key: {}", key);
}
<!-- gh-comment-id:1532958972 --> @bluebyt commented on GitHub (May 3, 2023): I add these line, but it doesn't output anything. ``` let key = component.label().replace(' ', "-"); let temp = component.temperature(); format_info.insert(format!("temp_c:{key}"), format!("{temp:.0}")); format_info.insert(format!("temp_f:{key}"), format!("{:.0}", c_to_f(temp))); // Log all keys in format_info for key in format_info.keys() { println!("Format info key: {}", key); } ```
Author
Owner

@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.

<!-- gh-comment-id:1535993445 --> @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.
Author
Owner

@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

<!-- gh-comment-id:1537158990 --> @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
Author
Owner

@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}°C does 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:cpu that then looks for the right value.

<!-- gh-comment-id:1537455480 --> @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}°C` does 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:cpu` that then looks for the right value.
Author
Owner

@bluebyt commented on GitHub (May 7, 2023):

@JakeStanger
Here you go!
https://pastebin.com/2bD8z17m

<!-- gh-comment-id:1537485252 --> @bluebyt commented on GitHub (May 7, 2023): @JakeStanger Here you go! https://pastebin.com/2bD8z17m
Author
Owner

@JakeStanger commented on GitHub (May 7, 2023):

Aha - it should be coretemp-Package-id-0 with a hyphen, rather than an underscore before Package.

I've just added a sentence to the wiki with the typical Intel & AMD names as a stopgap for now.

<!-- gh-comment-id:1537489759 --> @JakeStanger commented on GitHub (May 7, 2023): Aha - it should be `coretemp-Package-id-0` with a hyphen, rather than an underscore before `Package`. I've just added a sentence to the wiki with the typical Intel & AMD names as a stopgap for now.
Author
Owner

@bluebyt commented on GitHub (May 7, 2023):

Yes its working, thank you!
I followed the wiki for this part
{temp_c:k10temp_Tccd1}

<!-- gh-comment-id:1537491895 --> @bluebyt commented on GitHub (May 7, 2023): Yes its working, thank you! I followed the wiki for this part {temp_c:k10temp_Tccd1}
Author
Owner

@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.

<!-- gh-comment-id:1537492534 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#1474
No description provided.