diff --git a/CHANGELOG.md b/CHANGELOG.md index 0099ee179..6f89f97f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 2.19.1 + +Bugfixes +* Fix frequency value printing when using custom format (#1111, CPU / GPU) +* Fix display detection for XiaoMi Android phone (Display, Android) + +Features: +* Display if HDR mode is enabled for screens (Display) + * Supported in Windows and Linux (KDE) correctly + # 2.19.0 Changes: diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a9a4b9a0..f22ac9896 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 2.19.0 + VERSION 2.19.1 LANGUAGES C DESCRIPTION "Fast neofetch-like system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" diff --git a/README.md b/README.md index 54bcf1fd4..cd25100d8 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ Alternatively, you can refer to the presets in [`presets` directory](https://git The **correct** way to edit the configuration: +This is an example that [changes size prefix from MiB / GiB to MB / GB](https://github.com/fastfetch-cli/fastfetch/discussions/1014). Editor used: [helix](https://github.com/helix-editor/helix) + [![asciicast](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ.svg)](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ) ### Q: I WANT THE DOCUMENTATION! diff --git a/src/detection/displayserver/displayserver_android.c b/src/detection/displayserver/displayserver_android.c index a81f763b2..a51d850f4 100644 --- a/src/detection/displayserver/displayserver_android.c +++ b/src/detection/displayserver/displayserver_android.c @@ -82,25 +82,25 @@ static bool detectWithGetprop(FFDisplayServerResult* ds) if (ffSettingsGetAndroidProperty("persist.sys.miui_resolution", &buffer) && ffStrbufContainC(&buffer, ',')) { - // 1440,3200,560 => width,height,ppi + // 1440,3200,560 => width,height,densityDpi uint32_t width = (uint32_t) ffStrbufToUInt(&buffer, 0); ffStrbufSubstrAfterFirstC(&buffer, ','); uint32_t height = (uint32_t) ffStrbufToUInt(&buffer, 0); ffStrbufSubstrAfterFirstC(&buffer, ','); - uint32_t ppi = (uint32_t) ffStrbufToUInt(&buffer, 0); + double scaleFactor = (double) ffStrbufToUInt(&buffer, 0) / 160.; return ffdsAppendDisplay(ds, width, height, 0, - 0, - 0, + (uint32_t) (width / scaleFactor + .5), + (uint32_t) (height / scaleFactor + .5), 0, 0, FF_DISPLAY_TYPE_BUILTIN, false, 0, - (uint32_t) (width / ppi * 25.4), - (uint32_t) (height / ppi * 25.4) + 0, + 0 ); } diff --git a/src/modules/cpu/cpu.c b/src/modules/cpu/cpu.c index a0df7cb7f..eef95001f 100644 --- a/src/modules/cpu/cpu.c +++ b/src/modules/cpu/cpu.c @@ -95,7 +95,7 @@ void ffPrintCPU(FFCPUOptions* options) FF_STRBUF_AUTO_DESTROY freqBase = ffStrbufCreate(); ffParseFrequency(cpu.frequencyBase, &freqBase); FF_STRBUF_AUTO_DESTROY freqMax = ffStrbufCreate(); - ffParseFrequency(cpu.frequencyBase, &freqBase); + ffParseFrequency(cpu.frequencyBase, &freqMax); FF_STRBUF_AUTO_DESTROY freqBioslimit = ffStrbufCreate(); ffParseFrequency(cpu.frequencyBiosLimit, &freqBioslimit); diff --git a/src/modules/display/display.c b/src/modules/display/display.c index 707336432..93cdecbe5 100644 --- a/src/modules/display/display.c +++ b/src/modules/display/display.c @@ -6,7 +6,7 @@ #include -#define FF_DISPLAY_NUM_FORMAT_ARGS 13 +#define FF_DISPLAY_NUM_FORMAT_ARGS 16 static int sortByNameAsc(FFDisplayResult* a, FFDisplayResult* b) { @@ -126,6 +126,9 @@ void ffPrintDisplay(FFDisplayOptions* options) if(result->type != FF_DISPLAY_TYPE_UNKNOWN) ffStrbufAppendS(&buffer, result->type == FF_DISPLAY_TYPE_BUILTIN ? " [Built-in]" : " [External]"); + if (result->hdrEnabled) + ffStrbufAppendS(&buffer, " [HDR]"); + if(moduleIndex > 0 && result->primary) ffStrbufAppendS(&buffer, " *"); @@ -150,6 +153,9 @@ void ffPrintDisplay(FFDisplayOptions* options) {FF_FORMAT_ARG_TYPE_UINT, &result->physicalHeight, "physical-height"}, {FF_FORMAT_ARG_TYPE_DOUBLE, &inch, "inch"}, {FF_FORMAT_ARG_TYPE_DOUBLE, &ppi, "ppi"}, + {FF_FORMAT_ARG_TYPE_UINT8, &result->bitDepth, "bit-depth"}, + {FF_FORMAT_ARG_TYPE_BOOL, &result->hdrEnabled, "hdr-enabled"}, + {FF_FORMAT_ARG_TYPE_BOOL, &result->wcgEnabled, "wcg-enabled"}, })); } } @@ -352,6 +358,9 @@ void ffPrintDisplayHelpFormat(void) "Screen physical height (in millimeters) - physical-height", "Physical diagonal length in inches - inch", "Pixels per inch (PPI) - ppi", + "Bits per color channel - bit-depth", + "True if high dynamic range (HDR) is enabled - hdr-enabled", + "True if wide color gamut (WCG) is enabled - wcg-enabled", })); } diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index 22cef578c..a653b34ac 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -87,6 +87,9 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu if (gpu->shared.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.total, &sTotal); if (gpu->shared.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.used, &sUsed); + FF_STRBUF_AUTO_DESTROY frequency = ffStrbufCreate(); + ffParseFrequency(gpu->frequency, &frequency); + FF_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_GPU_NUM_FORMAT_ARGS, ((FFformatarg[]) { {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor, "vendor"}, {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name, "name"}, @@ -99,7 +102,7 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu {FF_FORMAT_ARG_TYPE_STRBUF, &sTotal, "shared-total"}, {FF_FORMAT_ARG_TYPE_STRBUF, &sUsed, "shared-used"}, {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->platformApi, "platform-api"}, - {FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->frequency, "frequency"}, + {FF_FORMAT_ARG_TYPE_STRBUF, &frequency, "frequency"}, })); } } diff --git a/src/options/display.c b/src/options/display.c index 117cd689f..c29370864 100644 --- a/src/options/display.c +++ b/src/options/display.c @@ -392,6 +392,8 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key const char* subkey = key + strlen("--freq-"); if(ffStrEqualsIgnCase(subkey, "ndigits")) options->freqNdigits = (int8_t) ffOptionParseInt32(key, value); + else + return false; } else return false;