From 9465e9b01439b6c3c941c89ab062461a595292ed Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sat, 27 Nov 2021 18:24:40 +0100 Subject: [PATCH] Fixed: coretemp ordering --- src/linux/btop_collect.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index 468fd6d..bf869df 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -333,7 +333,16 @@ namespace Cpu { } catch (...) {} - if (not got_coretemp or core_sensors.empty()) cpu_temp_only = true; + if (not got_coretemp or core_sensors.empty()) { + cpu_temp_only = true; + } + else { + rng::sort(core_sensors, rng::less{}); + rng::stable_sort(core_sensors, [](const auto& a, const auto& b){ + return a.size() < b.size(); + }); + } + if (cpu_sensor.empty() and not found_sensors.empty()) { for (const auto& [name, sensor] : found_sensors) { if (s_contains(str_to_lower(name), "cpu") or s_contains(str_to_lower(name), "k10temp")) {