Skip to content

Commit fa5a74c

Browse files
authored
Merge pull request #1115 from fastfetch-cli/dev
Release: v2.19.1
2 parents 7c15d0c + 4c6e14b commit fa5a74c

File tree

8 files changed

+36
-10
lines changed

8 files changed

+36
-10
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 2.19.1
2+
3+
Bugfixes
4+
* Fix frequency value printing when using custom format (#1111, CPU / GPU)
5+
* Fix display detection for XiaoMi Android phone (Display, Android)
6+
7+
Features:
8+
* Display if HDR mode is enabled for screens (Display)
9+
* Supported in Windows and Linux (KDE) correctly
10+
111
# 2.19.0
212

313
Changes:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
22

33
project(fastfetch
4-
VERSION 2.19.0
4+
VERSION 2.19.1
55
LANGUAGES C
66
DESCRIPTION "Fast neofetch-like system information tool"
77
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ Alternatively, you can refer to the presets in [`presets` directory](https://git
128128

129129
The **correct** way to edit the configuration:
130130

131+
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)
132+
131133
[![asciicast](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ.svg)](https://asciinema.org/a/1uF6sTPGKrHKI1MVaFcikINSQ)
132134

133135
### Q: I WANT THE DOCUMENTATION!

src/detection/displayserver/displayserver_android.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,25 @@ static bool detectWithGetprop(FFDisplayServerResult* ds)
8282
if (ffSettingsGetAndroidProperty("persist.sys.miui_resolution", &buffer) &&
8383
ffStrbufContainC(&buffer, ','))
8484
{
85-
// 1440,3200,560 => width,height,ppi
85+
// 1440,3200,560 => width,height,densityDpi
8686
uint32_t width = (uint32_t) ffStrbufToUInt(&buffer, 0);
8787
ffStrbufSubstrAfterFirstC(&buffer, ',');
8888
uint32_t height = (uint32_t) ffStrbufToUInt(&buffer, 0);
8989
ffStrbufSubstrAfterFirstC(&buffer, ',');
90-
uint32_t ppi = (uint32_t) ffStrbufToUInt(&buffer, 0);
90+
double scaleFactor = (double) ffStrbufToUInt(&buffer, 0) / 160.;
9191
return ffdsAppendDisplay(ds,
9292
width,
9393
height,
9494
0,
95-
0,
96-
0,
95+
(uint32_t) (width / scaleFactor + .5),
96+
(uint32_t) (height / scaleFactor + .5),
9797
0,
9898
0,
9999
FF_DISPLAY_TYPE_BUILTIN,
100100
false,
101101
0,
102-
(uint32_t) (width / ppi * 25.4),
103-
(uint32_t) (height / ppi * 25.4)
102+
0,
103+
0
104104
);
105105
}
106106

src/modules/cpu/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void ffPrintCPU(FFCPUOptions* options)
9595
FF_STRBUF_AUTO_DESTROY freqBase = ffStrbufCreate();
9696
ffParseFrequency(cpu.frequencyBase, &freqBase);
9797
FF_STRBUF_AUTO_DESTROY freqMax = ffStrbufCreate();
98-
ffParseFrequency(cpu.frequencyBase, &freqBase);
98+
ffParseFrequency(cpu.frequencyBase, &freqMax);
9999
FF_STRBUF_AUTO_DESTROY freqBioslimit = ffStrbufCreate();
100100
ffParseFrequency(cpu.frequencyBiosLimit, &freqBioslimit);
101101

src/modules/display/display.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <math.h>
88

9-
#define FF_DISPLAY_NUM_FORMAT_ARGS 13
9+
#define FF_DISPLAY_NUM_FORMAT_ARGS 16
1010

1111
static int sortByNameAsc(FFDisplayResult* a, FFDisplayResult* b)
1212
{
@@ -126,6 +126,9 @@ void ffPrintDisplay(FFDisplayOptions* options)
126126
if(result->type != FF_DISPLAY_TYPE_UNKNOWN)
127127
ffStrbufAppendS(&buffer, result->type == FF_DISPLAY_TYPE_BUILTIN ? " [Built-in]" : " [External]");
128128

129+
if (result->hdrEnabled)
130+
ffStrbufAppendS(&buffer, " [HDR]");
131+
129132
if(moduleIndex > 0 && result->primary)
130133
ffStrbufAppendS(&buffer, " *");
131134

@@ -150,6 +153,9 @@ void ffPrintDisplay(FFDisplayOptions* options)
150153
{FF_FORMAT_ARG_TYPE_UINT, &result->physicalHeight, "physical-height"},
151154
{FF_FORMAT_ARG_TYPE_DOUBLE, &inch, "inch"},
152155
{FF_FORMAT_ARG_TYPE_DOUBLE, &ppi, "ppi"},
156+
{FF_FORMAT_ARG_TYPE_UINT8, &result->bitDepth, "bit-depth"},
157+
{FF_FORMAT_ARG_TYPE_BOOL, &result->hdrEnabled, "hdr-enabled"},
158+
{FF_FORMAT_ARG_TYPE_BOOL, &result->wcgEnabled, "wcg-enabled"},
153159
}));
154160
}
155161
}
@@ -352,6 +358,9 @@ void ffPrintDisplayHelpFormat(void)
352358
"Screen physical height (in millimeters) - physical-height",
353359
"Physical diagonal length in inches - inch",
354360
"Pixels per inch (PPI) - ppi",
361+
"Bits per color channel - bit-depth",
362+
"True if high dynamic range (HDR) is enabled - hdr-enabled",
363+
"True if wide color gamut (WCG) is enabled - wcg-enabled",
355364
}));
356365
}
357366

src/modules/gpu/gpu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
8787
if (gpu->shared.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.total, &sTotal);
8888
if (gpu->shared.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.used, &sUsed);
8989

90+
FF_STRBUF_AUTO_DESTROY frequency = ffStrbufCreate();
91+
ffParseFrequency(gpu->frequency, &frequency);
92+
9093
FF_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_GPU_NUM_FORMAT_ARGS, ((FFformatarg[]) {
9194
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor, "vendor"},
9295
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name, "name"},
@@ -99,7 +102,7 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
99102
{FF_FORMAT_ARG_TYPE_STRBUF, &sTotal, "shared-total"},
100103
{FF_FORMAT_ARG_TYPE_STRBUF, &sUsed, "shared-used"},
101104
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->platformApi, "platform-api"},
102-
{FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->frequency, "frequency"},
105+
{FF_FORMAT_ARG_TYPE_STRBUF, &frequency, "frequency"},
103106
}));
104107
}
105108
}

src/options/display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key
392392
const char* subkey = key + strlen("--freq-");
393393
if(ffStrEqualsIgnCase(subkey, "ndigits"))
394394
options->freqNdigits = (int8_t) ffOptionParseInt32(key, value);
395+
else
396+
return false;
395397
}
396398
else
397399
return false;

0 commit comments

Comments
 (0)