mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 17:41:41 +01:00
Temps: support macOS
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#define FF_BATTERY_MODULE_NAME "Battery"
|
||||
#define FF_BATTERY_NUM_FORMAT_ARGS 5
|
||||
|
||||
static void printBattery(FFinstance* instance, const BatteryResult* result, uint8_t index)
|
||||
static void printBattery(FFinstance* instance, BatteryResult* result, uint8_t index)
|
||||
{
|
||||
if(instance->config.battery.outputFormat.length == 0)
|
||||
{
|
||||
@@ -32,6 +32,9 @@ static void printBattery(FFinstance* instance, const BatteryResult* result, uint
|
||||
putchar(']');
|
||||
}
|
||||
|
||||
if(result->temperature == result->temperature) //FF_BATTERY_TEMP_UNSET
|
||||
printf(" - %.1f°C", result->temperature);
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
else
|
||||
@@ -41,7 +44,8 @@ static void printBattery(FFinstance* instance, const BatteryResult* result, uint
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->modelName},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->technology},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->capacity},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->status}
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->status},
|
||||
{FF_FORMAT_ARG_TYPE_DOUBLE, &result->temperature},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ void ffPrintCPU(FFinstance* instance)
|
||||
if(cpu->frequencyMax > 0.0)
|
||||
printf(" @ %.9g GHz", cpu->frequencyMax);
|
||||
|
||||
if(cpu->temperature == cpu->temperature) //FF_CPU_TEMP_UNSET
|
||||
printf(" - %.1f°C", cpu->temperature);
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
else
|
||||
|
||||
+4
-1
@@ -25,11 +25,14 @@ static void printGPUResult(FFinstance* instance, uint8_t index, FFcache* cache,
|
||||
if(gpu->coreCount != FF_GPU_CORE_COUNT_UNSET)
|
||||
ffStrbufAppendF(&output, " (%d)", gpu->coreCount);
|
||||
|
||||
if(gpu->temperature == gpu->temperature) //FF_GPU_TEMP_UNSET
|
||||
ffStrbufAppendF(&output, " - %.1f°C", gpu->temperature);
|
||||
|
||||
ffPrintAndAppendToCache(instance, FF_GPU_MODULE_NAME, index, &instance->config.gpu, cache, &output, FF_GPU_NUM_FORMAT_ARGS, (FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->driver},
|
||||
{FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->temperature},
|
||||
{FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->temperature}, //FIXME: temperature shouldn't be cached
|
||||
{FF_FORMAT_ARG_TYPE_INT, &gpu->coreCount},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user