diff --git a/presets/verbose b/presets/verbose index 6c8b92a13..c45314905 100644 --- a/presets/verbose +++ b/presets/verbose @@ -17,7 +17,7 @@ --cursor-format "Theme: {}; Size: {}" --terminal-format "Process: {}; Path: {}; Exe: {}" --terminal-font-format "Raw: {}; Name: {}; Size: {}; Styles: {}; Pretty: {}" ---cpu-format "Name: {}; Pretty: {}; Vendor: {}; Logical online: {}; Logical configured: {}; Physical: {}; Cores: {}; bios: {}; temperature: {}; scaling max: {}; scaling min: {}; info max: {}; info min: {}; cpuinfo: {}; frequency: {}" +--cpu-format "Name: {}; Pretty: {}; Vendor: {}; Logical online: {}; Logical configured: {}; Physical: {}; Cores: {}; temperature: {}; bios: {}; scaling max: {}; scaling min: {}; info max: {}; info min: {}; cpuinfo: {}; frequency: {}" --cpu-usage-format "Percentage: {}" --gpu-format "Vendor: {}; Vendor pretty: {}; Name: {}; Name pretty: {}; Driver: {}" --memory-format "Used: {}; Total: {}; Percentage: {}" diff --git a/src/common/format.c b/src/common/format.c index dd1d39038..d2077ff78 100644 --- a/src/common/format.c +++ b/src/common/format.c @@ -72,6 +72,7 @@ static inline bool formatArgSet(const FFformatarg* arg) { return arg->value != NULL && ( (arg->type == FF_FORMAT_ARG_TYPE_DOUBLE && *(double*)arg->value > 0) || + (arg->type == FF_FORMAT_ARG_TYPE_DOUBLE && *(double*)arg->value == *(double*)arg->value) || //NaN (arg->type == FF_FORMAT_ARG_TYPE_INT && *(int*)arg->value > 0) || (arg->type == FF_FORMAT_ARG_TYPE_STRBUF && ((FFstrbuf*)arg->value)->length > 0) || (arg->type == FF_FORMAT_ARG_TYPE_STRING && *(const char*)arg->value != '\0') || diff --git a/src/modules/cpu.c b/src/modules/cpu.c index 1d66d6b0d..86e4ef3f6 100644 --- a/src/modules/cpu.c +++ b/src/modules/cpu.c @@ -150,19 +150,21 @@ void ffPrintCPU(FFinstance* instance) ffStrbufSubstrBeforeFirstC(&namePretty, '@'); //Cut the speed output in the name as we append our own ffStrbufTrimRight(&namePretty, ' '); //If we removed the @ in previous step there was most likely a space before it - const FFTempsResult *temps = ffDetectTemps(&instance); + const FFTempsResult *temps = ffDetectTemps(instance); double cpuTemp = 0.0/0.0; //NaN - for(uint32_t i = 0; i< temps->values.length; i++) + for(uint32_t i = 0; i < temps->values.length; i++) { - FFTempValue *v = ffListGet(&temps->values, i); - if( - ffStrbufFirstIndexS(&v->name, "cpu") == v->name.length && - ffStrbufCompS(&v->name, "k10temp") != 0 && - ffStrbufCompS(&v->name, "coretemp") != 0 - ) break; + FFTempValue* value = ffListGet(&temps->values, i); - cpuTemp = (double) parseLong(&v->value) / 1000.0; + if( + ffStrbufFirstIndexS(&value->name, "cpu") < value->name.length || + ffStrbufCompS(&value->name, "k10temp") == 0 || + ffStrbufCompS(&value->name, "coretemp") == 0 + ) { + cpuTemp = (double) parseLong(&value->value) / 1000.0; + break; + } } FFstrbuf cpu;