Compare commits

..

8 Commits

Author SHA1 Message Date
Carter Li fa5a74c746 Merge pull request #1115 from fastfetch-cli/dev
Release: v2.19.1
2024-07-23 10:10:49 +08:00
李通洲 4c6e14bcc2 Release: v2.19.1 2024-07-23 09:56:17 +08:00
李通洲 deacecdc11 Fastfetch: print error when invalid freq option is found 2024-07-23 09:55:48 +08:00
李通洲 83dcdaa726 GPU: fix frequency printing when using custom formation 2024-07-23 09:50:51 +08:00
李通洲 2c29465f69 Doc: update README [ci skip] 2024-07-23 09:39:22 +08:00
李通洲 f3e48a00a0 Display (Android): fix MiUI
560 is density dpi, not physical dpi
2024-07-23 09:27:07 +08:00
李通洲 9559db556d Display: print [HDR] if enabled 2024-07-23 09:27:07 +08:00
Carter Li b89eeaa954 CPU: fix double frequency value when using custom formation
Fix #1111
2024-07-22 22:14:43 +08:00
8 changed files with 36 additions and 10 deletions
+10
View File
@@ -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:
+1 -1
View File
@@ -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"
+2
View File
@@ -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!
@@ -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
);
}
+1 -1
View File
@@ -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);
+10 -1
View File
@@ -6,7 +6,7 @@
#include <math.h>
#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",
}));
}
+4 -1
View File
@@ -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"},
}));
}
}
+2
View File
@@ -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;