mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Bios: print as ${version} (${release})
As biosRelease looks more like a version on my laptop
This commit is contained in:
@@ -7,7 +7,7 @@ const char* ffDetectBios(FFBiosResult* bios)
|
||||
if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\BIOS", &hKey, NULL))
|
||||
return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\BIOS\", &hKey, NULL) failed";
|
||||
|
||||
if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->biosRelease, NULL))
|
||||
if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->biosVersion, NULL))
|
||||
return "\"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion\" doesn't exist";
|
||||
|
||||
ffRegReadStrbuf(hKey, L"BIOSVendor", &bios->biosVendor, NULL);
|
||||
@@ -18,7 +18,7 @@ const char* ffDetectBios(FFBiosResult* bios)
|
||||
ffRegReadUint(hKey, L"BiosMajorRelease", &major, NULL) &&
|
||||
ffRegReadUint(hKey, L"BiosMinorRelease", &minor, NULL)
|
||||
)
|
||||
ffStrbufAppendF(&bios->biosVersion, "%u.%u", (unsigned)major, (unsigned)minor);
|
||||
ffStrbufAppendF(&bios->biosRelease, "%u.%u", (unsigned)major, (unsigned)minor);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -22,18 +22,18 @@ void ffPrintBios(FFinstance* instance, FFBiosOptions* options)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(bios.biosRelease.length == 0)
|
||||
if(bios.biosVersion.length == 0)
|
||||
{
|
||||
ffPrintError(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs, "bios_release is not set.");
|
||||
ffPrintError(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs, "bios_version is not set.");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(options->moduleArgs.outputFormat.length == 0)
|
||||
{
|
||||
ffPrintLogoAndKey(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs.key, &options->moduleArgs.keyColor);
|
||||
ffStrbufWriteTo(&bios.biosRelease, stdout);
|
||||
if (bios.biosVersion.length)
|
||||
printf(" (%s)", bios.biosVersion.chars);
|
||||
ffStrbufWriteTo(&bios.biosVersion, stdout);
|
||||
if (bios.biosRelease.length)
|
||||
printf(" (%s)", bios.biosRelease.chars);
|
||||
putchar('\n');
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user