Skip to content

Commit d662568

Browse files
author
WolfTech Innovations
authored
Merge branch 'fastfetch-cli:dev' into dev
2 parents d1f4e78 + e6af1bf commit d662568

File tree

16 files changed

+172
-44
lines changed

16 files changed

+172
-44
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
run: ldd fastfetch
5757

5858
- name: run tests
59-
run: ctest
59+
run: ctest --output-on-failure
6060

6161
linux-amd64:
6262
name: Linux-amd64
@@ -111,7 +111,7 @@ jobs:
111111
run: ldd fastfetch
112112

113113
- name: run tests
114-
run: ctest
114+
run: ctest --output-on-failure
115115

116116
- name: get fastfetch version
117117
id: ffversion
@@ -150,7 +150,7 @@ jobs:
150150
time ./fastfetch -c presets/ci.jsonc --format json
151151
time ./flashfetch
152152
ldd fastfetch
153-
ctest
153+
ctest --output-on-failure
154154
155155
- name: upload artifacts
156156
uses: actions/upload-artifact@v4
@@ -189,7 +189,7 @@ jobs:
189189
time ./fastfetch -c presets/ci.jsonc --format json
190190
time ./flashfetch
191191
ldd fastfetch
192-
ctest
192+
ctest --output-on-failure
193193
194194
- name: upload artifacts
195195
uses: actions/upload-artifact@v4
@@ -225,7 +225,7 @@ jobs:
225225
time ./fastfetch -c presets/ci.jsonc --format json
226226
time ./flashfetch
227227
ldd fastfetch
228-
ctest
228+
ctest --output-on-failure
229229
230230
- name: upload artifacts
231231
uses: actions/upload-artifact@v4
@@ -260,7 +260,7 @@ jobs:
260260
time ./fastfetch -c presets/ci.jsonc --format json
261261
time ./flashfetch
262262
ldd fastfetch
263-
ctest
263+
ctest --output-on-failure
264264
265265
- name: upload artifacts
266266
uses: actions/upload-artifact@v4
@@ -295,14 +295,49 @@ jobs:
295295
time ./fastfetch -c presets/ci.jsonc --format json
296296
time ./flashfetch
297297
ldd fastfetch
298-
ctest
298+
ctest --output-on-failure
299299
300300
- name: upload artifacts
301301
uses: actions/upload-artifact@v4
302302
with:
303303
name: fastfetch-linux-ppc64le
304304
path: ./fastfetch-*.*
305305

306+
linux-s390x:
307+
name: Linux-s390x
308+
runs-on: ubuntu-22.04
309+
permissions:
310+
security-events: write
311+
contents: read
312+
steps:
313+
- name: checkout repository
314+
uses: actions/checkout@v4
315+
316+
- name: run VM
317+
uses: uraimo/run-on-arch-action@v2
318+
id: runcmd
319+
with:
320+
arch: s390x
321+
distro: ubuntu20.04
322+
githubToken: ${{ github.token }}
323+
run: |
324+
uname -a
325+
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libchafa-dev libelf-dev directx-headers-dev rpm
326+
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
327+
cmake --build . --target package --verbose -j4
328+
./fastfetch --list-features
329+
time ./fastfetch -c presets/ci.jsonc --stat false
330+
time ./fastfetch -c presets/ci.jsonc --format json
331+
time ./flashfetch
332+
ldd fastfetch
333+
ctest --output-on-failure
334+
335+
- name: upload artifacts
336+
uses: actions/upload-artifact@v4
337+
with:
338+
name: fastfetch-linux-s390x
339+
path: ./fastfetch-*.*
340+
306341
musl-amd64:
307342
name: Musl-amd64
308343
runs-on: ubuntu-latest
@@ -334,7 +369,7 @@ jobs:
334369
time ./fastfetch -c presets/ci.jsonc --format json
335370
time ./flashfetch
336371
ldd fastfetch
337-
ctest
372+
ctest --output-on-failure
338373
shell: alpine.sh {0}
339374

340375
- name: upload artifacts
@@ -390,7 +425,7 @@ jobs:
390425
run: otool -L fastfetch
391426

392427
- name: run tests
393-
run: ctest
428+
run: ctest --output-on-failure
394429

395430
- name: upload artifacts
396431
uses: actions/upload-artifact@v4
@@ -422,7 +457,7 @@ jobs:
422457
time ./fastfetch -c presets/ci.jsonc --format json
423458
time ./flashfetch
424459
ldd fastfetch
425-
ctest
460+
ctest --output-on-failure
426461
cpack
427462
428463
- name: upload artifacts
@@ -460,7 +495,7 @@ jobs:
460495
time ./fastfetch -c presets/ci.jsonc --format json
461496
time ./flashfetch
462497
ldd fastfetch
463-
ctest
498+
ctest --output-on-failure
464499
465500
- name: upload artifacts
466501
uses: actions/upload-artifact@v4
@@ -495,7 +530,7 @@ jobs:
495530
time ./fastfetch -c presets/ci.jsonc --format json
496531
time ./flashfetch
497532
ldd fastfetch
498-
ctest
533+
ctest --output-on-failure
499534
500535
- name: upload artifacts
501536
uses: actions/upload-artifact@v4
@@ -531,7 +566,7 @@ jobs:
531566
time ./fastfetch -c presets/ci.jsonc --format json
532567
time ./flashfetch
533568
ldd fastfetch
534-
ctest
569+
ctest --output-on-failure
535570
536571
- name: upload artifacts
537572
uses: actions/upload-artifact@v4
@@ -567,7 +602,7 @@ jobs:
567602
time ./fastfetch -c presets/ci.jsonc --format json
568603
time ./flashfetch
569604
ldd fastfetch
570-
ctest
605+
ctest --output-on-failure
571606
572607
- name: upload artifacts
573608
uses: actions/upload-artifact@v4
@@ -626,7 +661,7 @@ jobs:
626661
run: ldd fastfetch
627662

628663
- name: run tests
629-
run: ctest
664+
run: ctest --output-on-failure
630665

631666
- name: create zip archive
632667
run: 7z a -tzip -mx9 -bd -y fastfetch-windows-amd64.zip LICENSE *.dll fastfetch.exe flashfetch.exe presets
@@ -651,6 +686,7 @@ jobs:
651686
- linux-armv6
652687
- linux-riscv64
653688
- linux-ppc64le
689+
- linux-s390x
654690
- musl-amd64
655691
- macos-universal
656692
- freebsd-amd64

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# 2.36.0
2+
3+
Bugfixes:
4+
* Trim leading slash for login shells (Shell, OpenBSD)
5+
* Prefer SOC name if available over CPU name (CPU, Linux)
6+
7+
Features:
8+
* Use kernel API to detect sound devices (Sound, NetBSD)
9+
* Use sndio for sound server detection on OpenBSD (Sound, OpenBSD)
10+
* Add minimal implementation for Haiku (#1538, Haiku)
11+
* Support CPU & GPU temperature detection for M4x (CPU / GPU, macOS)
12+
* Support VMEM size detection for old Nvidia cards (GPU, Linux)
13+
* Use [recommendedMaxWorkingSetSize](https://developer.apple.com/documentation/metal/mtldevice/recommendedmaxworkingsetsize) as total GPU mem size (GPU, macOS)
14+
* Support Physical core count and CPU package count detection for loongarch (CPU, Linux)
15+
* Split ID_LIKE when used for distro matching (#1540, Logo)
16+
* Capitalize `{type}`'s first letter in custom format (#1543, Display)
17+
* Support model name detection for s390x (CPU, Linux)
18+
* Support more Armbian variants detection (#1547, OS, Linux)
19+
* Support the syntax of `{$ENV_VAR}` in custom format, which will be replaced by the value of the environment variable `ENV_VAR` (#1541)
20+
* This is another way to pass 3rd-party data to fastfetch besides `Custom` module.
21+
* Improve performance of Tilix version detection (Terminal, Linux)
22+
23+
Logo:
24+
* Update arch_old
25+
* Add Nexa Linux
26+
* Add filotimo
27+
* Update some distro names
28+
129
# 2.35.0
230

331
Bugfixes:

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
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.35.0
4+
VERSION 2.36.0
55
LANGUAGES C
66
DESCRIPTION "Fast neofetch-like system information tool"
77
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -72,8 +72,8 @@ cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX OR F
7272
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR APPLE OR SunOS" OFF)
7373
cmake_dependent_option(ENABLE_CHAFA "Enable chafa" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
7474
cmake_dependent_option(ENABLE_ZLIB "Enable zlib" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
75-
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR WIN32 OR SunOS" OFF)
76-
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS" OFF)
75+
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR WIN32 OR SunOS OR Haiku" OFF)
76+
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR ANDROID OR SunOS OR Haiku" OFF)
7777
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR SunOS" OFF)
7878
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR FreeBSD OR OpenBSD OR NetBSD OR WIN32 OR ANDROID OR SunOS" OFF)
7979
cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
fastfetch (2.36.0) jammy; urgency=medium
2+
3+
* Update to 2.36.0
4+
5+
-- Carter Li <[email protected]> Mon, 10 Feb 2025 10:13:53 +0800
6+
17
fastfetch (2.35.0) jammy; urgency=medium
28

39
* Update to 2.35.0

debian/files

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fastfetch_2.35.0_source.buildinfo universe/utils optional
1+
fastfetch_2.36.0_source.buildinfo universe/utils optional

doc/json_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"type": "string"
180180
},
181181
"displayFormat": {
182-
"description": "Output format of the module `Display`. See `-h format` for formatting syntax\n 1. {width}: Screen configured width (in pixels)\n 2. {height}: Screen configured height (in pixels)\n 3. {refresh-rate}: Screen configured refresh rate (in Hz)\n 4. {scaled-width}: Screen scaled width (in pixels)\n 5. {scaled-height}: Screen scaled height (in pixels)\n 6. {name}: Screen name\n 7. {type}: Screen type (builtin, external or unknown)\n 8. {rotation}: Screen rotation (in degrees)\n 9. {is-primary}: True if being the primary screen\n 10. {physical-width}: Screen physical width (in millimeters)\n 11. {physical-height}: Screen physical height (in millimeters)\n 12. {inch}: Physical diagonal length in inches\n 13. {ppi}: Pixels per inch (PPI)\n 14. {bit-depth}: Bits per color channel\n 15. {hdr-enabled}: True if high dynamic range (HDR) mode is enabled\n 16. {manufacture-year}: Year of manufacturing\n 17. {manufacture-week}: Nth week of manufacturing in the year\n 18. {serial}: Serial number\n 19. {platform-api}: The platform API used when detecting the display\n 20. {hdr-compatible}: True if the display is HDR compatible\n 21. {scale-factor}: HiDPI scale factor\n 22. {preferred-width}: Screen preferred width (in pixels)\n 23. {preferred-height}: Screen preferred height (in pixels)\n 24. {preferred-refresh-rate}: Screen preferred refresh rate (in Hz)",
182+
"description": "Output format of the module `Display`. See `-h format` for formatting syntax\n 1. {width}: Screen configured width (in pixels)\n 2. {height}: Screen configured height (in pixels)\n 3. {refresh-rate}: Screen configured refresh rate (in Hz)\n 4. {scaled-width}: Screen scaled width (in pixels)\n 5. {scaled-height}: Screen scaled height (in pixels)\n 6. {name}: Screen name\n 7. {type}: Screen type (Built-in or External)\n 8. {rotation}: Screen rotation (in degrees)\n 9. {is-primary}: True if being the primary screen\n 10. {physical-width}: Screen physical width (in millimeters)\n 11. {physical-height}: Screen physical height (in millimeters)\n 12. {inch}: Physical diagonal length in inches\n 13. {ppi}: Pixels per inch (PPI)\n 14. {bit-depth}: Bits per color channel\n 15. {hdr-enabled}: True if high dynamic range (HDR) mode is enabled\n 16. {manufacture-year}: Year of manufacturing\n 17. {manufacture-week}: Nth week of manufacturing in the year\n 18. {serial}: Serial number\n 19. {platform-api}: The platform API used when detecting the display\n 20. {hdr-compatible}: True if the display is HDR compatible\n 21. {scale-factor}: HiDPI scale factor\n 22. {preferred-width}: Screen preferred width (in pixels)\n 23. {preferred-height}: Screen preferred height (in pixels)\n 24. {preferred-refresh-rate}: Screen preferred refresh rate (in Hz)",
183183
"type": "string"
184184
},
185185
"diskFormat": {

src/common/format.c

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,24 +259,33 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
259259
continue;
260260
}
261261

262-
//test for constant, if so evaluate it
262+
//test for constant or env var, if so evaluate it
263263
if (firstChar == '$')
264264
{
265265
char* pend = NULL;
266266
int32_t indexSigned = (int32_t) strtol(placeholderValue.chars + 1, &pend, 10);
267-
uint32_t index = (uint32_t) indexSigned;
268-
bool backward = indexSigned < 0;
269-
270-
if (indexSigned == 0 || *pend != '\0' || instance.config.display.constants.length < index)
267+
if (pend == placeholderValue.chars + 1)
271268
{
272-
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
273-
continue;
269+
// treat placeholder as an environment variable
270+
char* envValue = getenv(placeholderValue.chars + 1);
271+
if (envValue)
272+
ffStrbufAppendS(buffer, envValue);
273+
else
274+
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
274275
}
276+
else
277+
{
278+
// treat placeholder as a constant
279+
uint32_t index = (uint32_t) (indexSigned < 0 ? (int32_t) instance.config.display.constants.length + indexSigned : indexSigned - 1);
275280

276-
FFstrbuf* item = FF_LIST_GET(FFstrbuf, instance.config.display.constants, backward
277-
? instance.config.display.constants.length - index
278-
: index - 1);
279-
ffStrbufAppend(buffer, item);
281+
if (*pend != '\0' || instance.config.display.constants.length <= index)
282+
appendInvalidPlaceholder(buffer, "{", &placeholderValue, i, formatstr->length);
283+
else
284+
{
285+
FFstrbuf* item = FF_LIST_GET(FFstrbuf, instance.config.display.constants, index);
286+
ffStrbufAppend(buffer, item);
287+
}
288+
}
280289
continue;
281290
}
282291

src/data/help_format.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ In 2.24.0 or newer, `{~startIndex,endIndex}` can be specified to slice a string.
2121
If an index is omitted, 0 is used. For example, both `{~,0}` `{~0,}` and `{~,}` are same as `{~0,0}` and will always generate a empty string.
2222
If `,endIndex` is omitted or greater than the length of the string, the length of string is used.
2323

24+
In 2.36.0 or newer, `{$NUM}` can be specified to reference a constant defined in `display.constants`. `{$ENV_VAR}` can be specified to reference an environment variable.
25+
2426
If the value index is missing, meaning the placeholder is "{}", an internal counter sets the value index.
2527
This means that the format string "Values: {1} ({2})" is equivalent to "Values: {} ({})".
2628
Note that this counter only counts empty placeholders, so the format string "{2} {} {}" will contain the second value, then the first, and then the second again.

src/detection/cpu/cpu.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu)
1010
const char* removeStrings[] = {
1111
" CPU", " FPU", " APU", " Processor",
1212
" Dual-Core", " Quad-Core", " Six-Core", " Eight-Core", " Ten-Core",
13-
" 2-Core", " 4-Core", " 6-Core", " 8-Core", " 10-Core", " 12-Core", " 14-Core", " 16-Core",
14-
" with Radeon Graphics"
13+
" 2-Core", " 4-Core", " 6-Core", " 8-Core", " 10-Core", " 12-Core", " 14-Core", " 16-Core"
1514
};
1615
ffStrbufRemoveStrings(&cpu->name, ARRAY_SIZE(removeStrings), removeStrings);
16+
uint32_t radeonGraphics = ffStrbufFirstIndexS(&cpu->name, " w/ Radeon "); // w/ Radeon 780M Graphics
17+
if (radeonGraphics >= cpu->name.length)
18+
radeonGraphics = ffStrbufFirstIndexS(&cpu->name, " with Radeon ");
19+
if (radeonGraphics < cpu->name.length)
20+
ffStrbufSubstrBefore(&cpu->name, radeonGraphics);
1721
ffStrbufSubstrBeforeFirstC(&cpu->name, '@'); //Cut the speed output in the name as we append our own
1822
ffStrbufTrimRight(&cpu->name, ' '); //If we removed the @ in previous step there was most likely a space before it
1923
ffStrbufRemoveDupWhitespaces(&cpu->name);

src/detection/cpu/cpu_linux.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,26 @@ static const char* parseCpuInfo(
303303
(cpuImplementer->length == 0 && ffParsePropLine(line, "CPU implementer :", cpuImplementer)) ||
304304
(cpu->name.length == 0 && ffParsePropLine(line, "Hardware :", &cpu->name)) || //For Android devices
305305
#elif __powerpc__ || __powerpc
306-
(cpuMHz->length == 0 && ffParsePropLine(line, "clock :", cpuMHz)) || //For POWER
307-
(cpu->name.length == 0 && ffParsePropLine(line, "cpu :", &cpu->name)) || //For POWER
306+
(cpuMHz->length == 0 && ffParsePropLine(line, "clock :", cpuMHz)) ||
307+
(cpu->name.length == 0 && ffParsePropLine(line, "cpu :", &cpu->name)) ||
308308
#elif __mips__ || __mips
309-
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) || //For MIPS
309+
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) ||
310310
#elif __loongarch__
311311
(cpu->name.length == 0 && ffParsePropLine(line, "Model Name :", &cpu->name)) ||
312312
(cpuMHz->length == 0 && ffParsePropLine(line, "CPU MHz :", cpuMHz)) ||
313313
#elif __riscv__ || __riscv
314314
(cpuIsa->length == 0 && ffParsePropLine(line, "isa :", cpuIsa)) ||
315315
(cpuUarch->length == 0 && ffParsePropLine(line, "uarch :", cpuUarch)) ||
316+
#elif __s390x__
317+
(cpu->name.length == 0 && ffParsePropLine(line, "processor 0:", &cpu->name)) ||
318+
(cpu->vendor.length == 0 && ffParsePropLine(line, "vendor_id :", &cpu->vendor)) ||
319+
(cpuMHz->length == 0 && ffParsePropLine(line, "cpu MHz static :", cpuMHz)) || // This one cannot be detected because of early return
316320
#else
317321
(cpu->name.length == 0 && ffParsePropLine(line, "model name :", &cpu->name)) ||
322+
(cpu->name.length == 0 && ffParsePropLine(line, "model :", &cpu->name)) ||
323+
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) ||
324+
(cpu->name.length == 0 && ffParsePropLine(line, "hardware :", &cpu->name)) ||
325+
(cpu->name.length == 0 && ffParsePropLine(line, "processor :", &cpu->name)) ||
318326
#endif
319327

320328
false
@@ -651,6 +659,9 @@ FF_MAYBE_UNUSED static const char* detectCPUOthers(const FFCPUOptions* options,
651659
cpu->packages = getLoongarchPropCount(&cpuinfo, "\npackage\t\t\t:");
652660
cpu->coresPhysical = getLoongarchPropCount(&cpuinfo, "\ncore\t\t\t:");
653661
if (cpu->packages > 1) cpu->coresPhysical *= cpu->packages;
662+
#elif __s390x__
663+
if (ffStrbufSubstrAfterFirstS(&cpu->name, "machine = "))
664+
ffStrbufPrependS(&cpu->name, "Machine ");
654665
#endif
655666
}
656667

0 commit comments

Comments
 (0)