Skip to content

Commit d0d9831

Browse files
authored
Merge pull request #686 from fastfetch-cli/dev
Release v2.6.0
2 parents b80da99 + b3945e2 commit d0d9831

File tree

109 files changed

+2348
-1266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2348
-1266
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# 2.6.0
2+
3+
Changes:
4+
* Remove support of option `--battery-dir`. We detect a lot of things in `/sys/class/*` and only module `Battery` supports specifying a custom directory for some reason, which is weird.
5+
* Remove `--chassis-use-wmi` which is no longer used.
6+
7+
Features:
8+
* Add `ENABLE_PROPRIETARY_GPU_DRIVER_API` cmake option to disable using of proprietary GPU driver APIs (GPU)
9+
* Support wallpaper detection for macOS Sonoma (Wallpaper, macOS)
10+
* Support power adapter detection for Asahi Linux (PowerAdapter, Linux)
11+
* Support battery serial number and manufacturer date detection (Battery)
12+
* Support host serial number and UUID detection (Host)
13+
* Support battery level detection for gamepads where possible (Gamepad)
14+
* Support maximum CPU clock detection. Previously base clock was printed (CPU, Windows)
15+
* Support manufacture date and serial number detection for physical monitors (Monitor)
16+
* Support ash (default shell of BusyBox) version detection (Shell, Linux)
17+
* Sound module in FreeBSD now uses native `ioctl`s. Pulseaudio dependency is no longer used.
18+
* Locale module in Windows now prints the same format as in Linux and other posix systems.
19+
20+
Bugfixes:
21+
* Fix overall memory leaks (macOS)
22+
* Remove trailing `\0` in JSON results (FreeBSD)
23+
* Fix physical monitor detection with Nvidia drivers (Monitor, Linux)
24+
* Don't print llvmpipe in vulkan module (Vulkan)
25+
* Fix system yyjson usage in `fastfetch.c`. Previously embedded `3rdparty/yyjson/yyjson.h` was used in `fastfetch.c` even if `ENABLE_SYSTEM_YYJSON` was set (CMake)
26+
* Fix locale module printing unexpected results in specific environments (Locale)
27+
* Fix battery temperature detection in Windows. Note only smart batteries report temperatures but few laptops uses smart battery (Battery, Windows)
28+
* Print device name if no backlight name is available, so we don't print empty parentheses (Brightness, FreeBSD)
29+
130
# 2.5.0
231

332
Changes:

CMakeLists.txt

Lines changed: 44 additions & 20 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.5.0
4+
VERSION 2.6.0
55
LANGUAGES C
66
DESCRIPTION "Fast neofetch-like system information tool"
77
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -66,14 +66,15 @@ cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX OR BSD" OFF)
6666
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX OR BSD OR WIN32" OFF)
6767
cmake_dependent_option(ENABLE_LIBNM "Enable libnm" ON "LINUX" OFF)
6868
cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)
69-
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR BSD" OFF)
69+
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX" OFF)
7070
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
7171
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
7272
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
7373
cmake_dependent_option(ENABLE_PCI_MEMORY "Enable detecting GPU memory size with libpci" OFF "LINUX OR BSD" OFF)
7474

7575
option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
7676
option(ENABLE_ASAN "Build fastfetch with ASAN (address sanitizer)" OFF)
77+
option(ENABLE_PROPRIETARY_GPU_DRIVER_API "Enable proprietary GPU driver API (NVML, IGCL and AGS)" ON)
7778
option(BUILD_TESTS "Build tests" OFF) # Also create test executables
7879
option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by github actions for release builds
7980

@@ -109,12 +110,8 @@ endif()
109110

110111
if(WIN32)
111112
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--tsaware -Wl,--build-id -Wl,--subsystem,console:6.1,--major-os-version,6,--minor-os-version,1")
112-
endif()
113-
114-
# Used for dlopen finding dylibs installed by homebrew
115-
# `/opt/homebrew/lib` is not on in dlopen search path by default
116-
if(APPLE AND DEFINED ENV{HOMEBREW_PREFIX})
117-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ENV{HOMEBREW_PREFIX}/lib")
113+
elseif(APPLE)
114+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-arc")
118115
endif()
119116

120117
set(FASTFETCH_FLAGS_DEBUG "-fno-omit-frame-pointer")
@@ -290,7 +287,6 @@ set(LIBFASTFETCH_SRC
290287
src/detection/displayserver/displayserver.c
291288
src/detection/font/font.c
292289
src/detection/gpu/gpu.c
293-
src/detection/locale/locale.c
294290
src/detection/media/media.c
295291
src/detection/netio/netio.c
296292
src/detection/opencl/opencl.c
@@ -374,7 +370,6 @@ set(LIBFASTFETCH_SRC
374370
src/util/FFlist.c
375371
src/util/FFstrbuf.c
376372
src/util/platform/FFPlatform.c
377-
src/util/stringUtils.c
378373
src/util/smbiosHelper.c
379374
)
380375

@@ -405,12 +400,12 @@ if(LINUX)
405400
src/detection/displayserver/linux/xlib.c
406401
src/detection/font/font_linux.c
407402
src/detection/gpu/gpu_linux.c
408-
src/detection/gpu/gpu_nvidia.c
409403
src/detection/gtk_qt/gtk.c
410404
src/detection/host/host_linux.c
411405
src/detection/icons/icons_linux.c
412406
src/detection/libc/libc_linux.c
413407
src/detection/lm/lm_linux.c
408+
src/detection/locale/locale_linux.c
414409
src/detection/localip/localip_linux.c
415410
src/detection/gamepad/gamepad_linux.c
416411
src/detection/media/media_linux.c
@@ -420,7 +415,7 @@ if(LINUX)
420415
src/detection/opengl/opengl_linux.c
421416
src/detection/os/os_linux.c
422417
src/detection/packages/packages_linux.c
423-
src/detection/poweradapter/poweradapter_nosupport.c
418+
src/detection/poweradapter/poweradapter_linux.c
424419
src/detection/processes/processes_linux.c
425420
src/detection/gtk_qt/qt.c
426421
src/detection/sound/sound_linux.c
@@ -464,6 +459,7 @@ elseif(ANDROID)
464459
src/detection/icons/icons_nosupport.c
465460
src/detection/libc/libc_android.c
466461
src/detection/lm/lm_nosupport.c
462+
src/detection/locale/locale_linux.c
467463
src/detection/localip/localip_linux.c
468464
src/detection/gamepad/gamepad_nosupport.c
469465
src/detection/media/media_nosupport.c
@@ -519,12 +515,12 @@ elseif(BSD)
519515
src/detection/displayserver/linux/xlib.c
520516
src/detection/font/font_linux.c
521517
src/detection/gpu/gpu_linux.c
522-
src/detection/gpu/gpu_nvidia.c
523518
src/detection/gtk_qt/gtk.c
524519
src/detection/host/host_bsd.c
525520
src/detection/lm/lm_linux.c
526521
src/detection/icons/icons_linux.c
527522
src/detection/libc/libc_bsd.c
523+
src/detection/locale/locale_linux.c
528524
src/detection/localip/localip_linux.c
529525
src/detection/gamepad/gamepad_bsd.c
530526
src/detection/media/media_linux.c
@@ -537,7 +533,7 @@ elseif(BSD)
537533
src/detection/poweradapter/poweradapter_nosupport.c
538534
src/detection/processes/processes_bsd.c
539535
src/detection/gtk_qt/qt.c
540-
src/detection/sound/sound_linux.c
536+
src/detection/sound/sound_bsd.c
541537
src/detection/swap/swap_bsd.c
542538
src/detection/temps/temps_bsd.c
543539
src/detection/terminalfont/terminalfont_linux.c
@@ -580,6 +576,7 @@ elseif(APPLE)
580576
src/detection/lm/lm_nosupport.c
581577
src/detection/icons/icons_nosupport.c
582578
src/detection/libc/libc_apple.c
579+
src/detection/locale/locale_linux.c
583580
src/detection/localip/localip_linux.c
584581
src/detection/gamepad/gamepad_apple.c
585582
src/detection/media/media_apple.m
@@ -600,7 +597,7 @@ elseif(APPLE)
600597
src/detection/theme/theme_nosupport.c
601598
src/detection/uptime/uptime_bsd.c
602599
src/detection/users/users_linux.c
603-
src/detection/wallpaper/wallpaper_apple.c
600+
src/detection/wallpaper/wallpaper_apple.m
604601
src/detection/wifi/wifi_apple.m
605602
src/detection/wm/wm_apple.c
606603
src/detection/de/de_nosupport.c
@@ -620,7 +617,7 @@ elseif(WIN32)
620617
src/detection/bluetooth/bluetooth_windows.c
621618
src/detection/board/board_windows.c
622619
src/detection/brightness/brightness_windows.cpp
623-
src/detection/chassis/chassis_windows.cpp
620+
src/detection/chassis/chassis_windows.c
624621
src/detection/cpu/cpu_windows.c
625622
src/detection/cpuusage/cpuusage_windows.c
626623
src/detection/cursor/cursor_windows.c
@@ -630,13 +627,11 @@ elseif(WIN32)
630627
src/detection/displayserver/displayserver_windows.c
631628
src/detection/font/font_windows.c
632629
src/detection/gpu/gpu_windows.c
633-
src/detection/gpu/gpu_nvidia.c
634-
src/detection/gpu/gpu_intel.c
635-
src/detection/gpu/gpu_amd.c
636630
src/detection/host/host_windows.c
637631
src/detection/icons/icons_windows.c
638632
src/detection/libc/libc_windows.cpp
639633
src/detection/lm/lm_nosupport.c
634+
src/detection/locale/locale_windows.c
640635
src/detection/localip/localip_windows.c
641636
src/detection/gamepad/gamepad_windows.c
642637
src/detection/media/media_nosupport.c
@@ -676,6 +671,17 @@ if(ENABLE_DIRECTX_HEADERS)
676671
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_wsl.cpp)
677672
endif()
678673

674+
if(ENABLE_PROPRIETARY_GPU_DRIVER_API AND (LINUX OR BSD OR WIN32))
675+
message(STATUS "Enabling proprietary GPU driver API")
676+
if(LINUX OR BSD OR WIN32)
677+
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_nvidia.c)
678+
endif()
679+
if(WIN32)
680+
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_intel.c)
681+
list(APPEND LIBFASTFETCH_SRC src/detection/gpu/gpu_amd.c)
682+
endif()
683+
endif()
684+
679685
include(CheckFunctionExists)
680686
check_function_exists(wcwidth HAVE_WCWIDTH)
681687
if(NOT HAVE_WCWIDTH)
@@ -699,9 +705,20 @@ add_library(libfastfetch OBJECT
699705
${LIBFASTFETCH_SRC}
700706
)
701707

708+
if(ENABLE_PROPRIETARY_GPU_DRIVER_API AND (LINUX OR BSD OR WIN32))
709+
target_compile_definitions(libfastfetch PRIVATE FF_USE_PROPRIETARY_GPU_DRIVER_API)
710+
endif()
711+
702712
if(yyjson_FOUND)
703713
target_compile_definitions(libfastfetch PRIVATE FF_USE_SYSTEM_YYJSON)
704-
target_link_libraries(libfastfetch PRIVATE yyjson)
714+
target_link_libraries(libfastfetch PRIVATE yyjson::yyjson)
715+
# `target_link_libraries(yyjson::yyjson)` sets rpath implicitly
716+
else()
717+
# Used for dlopen finding dylibs installed by homebrew
718+
# `/opt/homebrew/lib` is not on in dlopen search path by default
719+
if(APPLE AND DEFINED ENV{HOMEBREW_PREFIX})
720+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ENV{HOMEBREW_PREFIX}/lib")
721+
endif()
705722
endif()
706723

707724
if(LINUX AND EXISTS "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1")
@@ -993,6 +1010,13 @@ set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
9931010
set_target_properties(fastfetch PROPERTIES LINKER_LANGUAGE C)
9941011
set_target_properties(flashfetch PROPERTIES LINKER_LANGUAGE C)
9951012

1013+
if(yyjson_FOUND)
1014+
target_compile_definitions(fastfetch PRIVATE FF_USE_SYSTEM_YYJSON)
1015+
target_link_libraries(fastfetch PRIVATE yyjson::yyjson)
1016+
target_compile_definitions(flashfetch PRIVATE FF_USE_SYSTEM_YYJSON)
1017+
target_link_libraries(flashfetch PRIVATE yyjson::yyjson)
1018+
endif()
1019+
9961020
if(WIN32)
9971021
set(TARGET_NAME fastfetch)
9981022
target_sources(fastfetch

completions/bash

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ __fastfetch_completion()
384384
"--lib-pulse"
385385
"--lib-ddcutil"
386386
"--lib-nm"
387-
"--battery-dir"
388387
)
389388

390389
local FF_OPTIONS_LOGO=(

doc/json_schema.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,6 @@
804804
"const": "battery",
805805
"description": "Print battery capacity, status, etc"
806806
},
807-
"dir": {
808-
"description": "The directory where the battery folders are. Standard: `/sys/class/power_supply/`. Linux only",
809-
"type": "string"
810-
},
811807
"useSetupApi": {
812808
"description": "Set if `SetupAPI` should be used on Windows to detect battery info, which supports multi batteries, but slower. Windows only",
813809
"type": "boolean",
@@ -883,11 +879,6 @@
883879
"const": "chassis",
884880
"description": "Print chassis type (desktop, laptop, etc)"
885881
},
886-
"useWmi": {
887-
"description": "Set if WMI query should be used on Windows, which detects more information but slower",
888-
"type": "boolean",
889-
"default": false
890-
},
891882
"key": {
892883
"$ref": "#/$defs/key"
893884
},

src/common/init.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ void ffListFeatures(void)
244244
#ifdef FF_HAVE_DIRECTX_HEADERS
245245
"Directx Headers\n"
246246
#endif
247+
#ifdef FF_USE_PROPRIETARY_GPU_DRIVER_API
248+
"Proprietary GPU driver API\n"
249+
#endif
250+
#ifdef FF_USE_SYSTEM_YYJSON
251+
"System yyjson\n"
252+
#endif
253+
#ifdef FF_USE_PCI_MEMORY
254+
"PCI memory\n"
255+
#endif
247256
""
248257
, stdout);
249258
}

src/common/io/io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
105105

106106
unsigned int mode = fileStat.st_mode & S_IFMT;
107107

108-
if(pathType & FF_PATHTYPE_FILE && mode == S_IFREG)
108+
if(pathType & FF_PATHTYPE_FILE && mode != S_IFDIR)
109109
return true;
110110

111111
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)

src/common/processing_windows.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
8383

8484
char str[FF_PIPE_BUFSIZ];
8585
DWORD nRead = 0;
86-
FF_AUTO_CLOSE_FD HANDLE hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
87-
OVERLAPPED overlapped = { .hEvent = hEvent };
86+
OVERLAPPED overlapped = { };
8887
// ReadFile always completes synchronously if the pipe is not created with FILE_FLAG_OVERLAPPED
8988
do
9089
{
@@ -93,11 +92,11 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
9392
switch (GetLastError())
9493
{
9594
case ERROR_IO_PENDING:
96-
if (!timeout || WaitForSingleObject(hEvent, (DWORD) timeout) != WAIT_OBJECT_0)
95+
if (!timeout || WaitForSingleObject(hChildPipeRead, (DWORD) timeout) != WAIT_OBJECT_0)
9796
{
9897
CancelIo(hChildPipeRead);
9998
TerminateProcess(hProcess, 1);
100-
return "WaitForSingleObject(hEvent) failed or timeout";
99+
return "WaitForSingleObject(hChildPipeRead) failed or timeout";
101100
}
102101

103102
if (!GetOverlappedResult(hChildPipeRead, &overlapped, &nRead, FALSE))

src/common/settings.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,8 @@ bool ffSettingsGetFreeBSDKenv(const char* propName, FFstrbuf* result)
411411
//https://wiki.ghostbsd.org/index.php/Kenv
412412
ffStrbufEnsureFree(result, KENV_MVALLEN);
413413
int len = kenv(KENV_GET, propName, result->chars + result->length, KENV_MVALLEN);
414-
if (len <= 0) return false;
415-
result->length += (uint32_t) len;
416-
result->chars[result->length] = '\0';
414+
if (len <= 1) return false; // number of bytes copied, including NUL terminator
415+
result->length += (uint32_t) len - 1;
417416
return true;
418417
}
419418
#endif

src/data/help.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -842,16 +842,6 @@
842842
"default": "default"
843843
}
844844
},
845-
{
846-
"long": "chassis-use-wmi",
847-
"desc": "Set if WMI query should be used on Windows",
848-
"remark": "WMI query detects more information but is slower. Windows only",
849-
"arg": {
850-
"type": "bool",
851-
"optional": true,
852-
"default": false
853-
}
854-
},
855845
{
856846
"long": "separator-string",
857847
"desc": "Set the string printed by the separator module",
@@ -1026,15 +1016,6 @@
10261016
"default": "main"
10271017
}
10281018
},
1029-
{
1030-
"long": "battery-dir",
1031-
"desc": "The directory where the battery folders are",
1032-
"remark": "Linux only",
1033-
"arg": {
1034-
"type": "path",
1035-
"default": "/sys/class/power_supply/"
1036-
}
1037-
},
10381019
{
10391020
"long": "battery-use-setup-api",
10401021
"desc": "Set if \"SetupAPI\" should be used on Windows to detect battery info",

src/detection/battery/battery.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
typedef struct FFBatteryResult
88
{
99
FFstrbuf manufacturer;
10+
FFstrbuf manufactureDate;
1011
FFstrbuf modelName;
1112
FFstrbuf technology;
12-
double capacity;
1313
FFstrbuf status;
14+
FFstrbuf serial;
15+
double capacity;
1416
double temperature;
1517
uint32_t cycleCount;
1618
} FFBatteryResult;

0 commit comments

Comments
 (0)