Merge pull request #1056 from fastfetch-cli/dev

Release: v2.17.1
This commit is contained in:
Carter Li
2024-06-29 08:20:39 +08:00
committed by GitHub
10 changed files with 52 additions and 18 deletions
+13
View File
@@ -1,3 +1,16 @@
# 2.17.1
Hotfix for a regression that breaks Qt font detection
Bugfixes:
* Don't generate and install `libffwinrt.dll.a` on MinGW (Windows)
* Fix building on Windows when imagemagick support is enabled (Logo, Windows)
* Don't print GPU frequency with `--gpu-temp` for Nvidia cards (#1052, GPU)
* `--gpu-driver-specific` needs to be specified
* Print formatted size when `--gpu-format` is used (#1052, GPU)
* Ignore QVariant format; fix unreadable Qt font (#1053, Theme, Linux)
* Fix segfaults with `--show-errors` and an invalid module (#1055)
# 2.17.0 # 2.17.0
Changes: Changes:
+2 -2
View File
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
project(fastfetch project(fastfetch
VERSION 2.17.0 VERSION 2.17.1
LANGUAGES C LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool" DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -1156,7 +1156,7 @@ if(WIN32)
include(CheckIncludeFileCXX) include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT) CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT)
if(HAVE_WINRT) if(HAVE_WINRT)
add_library(ffwinrt SHARED src/detection/media/media_windows.dll.cpp) add_library(ffwinrt MODULE src/detection/media/media_windows.dll.cpp)
target_link_libraries(ffwinrt PRIVATE "RuntimeObject") target_link_libraries(ffwinrt PRIVATE "RuntimeObject")
target_compile_definitions(ffwinrt PRIVATE WIN32_LEAN_AND_MEAN=1 WINRT_LEAN_AND_MEAN=1) target_compile_definitions(ffwinrt PRIVATE WIN32_LEAN_AND_MEAN=1 WINRT_LEAN_AND_MEAN=1)
target_link_options(ffwinrt target_link_options(ffwinrt
+2
View File
@@ -8,11 +8,13 @@
#include <handleapi.h> #include <handleapi.h>
#include <io.h> #include <io.h>
typedef HANDLE FFNativeFD; typedef HANDLE FFNativeFD;
#define FF_INVALID_FD INVALID_HANDLE_VALUE
#else #else
#include <unistd.h> #include <unistd.h>
#include <dirent.h> #include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
typedef int FFNativeFD; typedef int FFNativeFD;
#define FF_INVALID_FD (-1)
// procfs's file can be changed between read calls such as /proc/meminfo and /proc/uptime. // procfs's file can be changed between read calls such as /proc/meminfo and /proc/uptime.
// one safe way to read correct data is reading the whole file in a single read syscall // one safe way to read correct data is reading the whole file in a single read syscall
// 8192 comes from procps-ng: https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L39 // 8192 comes from procps-ng: https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L39
+1 -1
View File
@@ -64,7 +64,7 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
if(!instance.config.display.pipe) if(!instance.config.display.pipe)
{ {
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout); fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (moduleArgs->outputColor.length) if (moduleArgs && moduleArgs->outputColor.length)
ffPrintColor(&moduleArgs->outputColor); ffPrintColor(&moduleArgs->outputColor);
else if (instance.config.display.colorOutput.length) else if (instance.config.display.colorOutput.length)
ffPrintColor(&instance.config.display.colorOutput); ffPrintColor(&instance.config.display.colorOutput);
+1 -1
View File
@@ -273,7 +273,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
.memory = options->driverSpecific ? &gpu->dedicated : NULL, .memory = options->driverSpecific ? &gpu->dedicated : NULL,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL, .coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type, .type = &gpu->type,
.frequency = &gpu->frequency, .frequency = options->driverSpecific ? &gpu->frequency : NULL,
}, "libnvidia-ml.so"); }, "libnvidia-ml.so");
} }
+1 -1
View File
@@ -162,7 +162,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
.memory = options->driverSpecific ? &gpu->dedicated : NULL, .memory = options->driverSpecific ? &gpu->dedicated : NULL,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL, .coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type, .type = &gpu->type,
.frequency = &gpu->frequency, .frequency = options->driverSpecific ? &gpu->frequency : NULL,
}, },
dllName dllName
); );
+1 -1
View File
@@ -120,7 +120,7 @@ const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FF
.memory = options->driverSpecific ? &gpu->dedicated : NULL, .memory = options->driverSpecific ? &gpu->dedicated : NULL,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL, .coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type, .type = &gpu->type,
.frequency = &gpu->frequency, .frequency = options->driverSpecific ? &gpu->frequency : NULL,
}, "/usr/lib/wsl/lib/libnvidia-ml.so"); }, "/usr/lib/wsl/lib/libnvidia-ml.so");
} }
} }
+8 -3
View File
@@ -144,11 +144,16 @@ static void detectQtCt(char qver, FFQtResult* result)
ffParsePropFileConfigValues(file, 3, (FFpropquery[]) { ffParsePropFileConfigValues(file, 3, (FFpropquery[]) {
{"style=", &result->widgetStyle}, {"style=", &result->widgetStyle},
{"icon_theme=", &result->icons}, {"icon_theme=", &result->icons},
// FIXME: on older versions this was hex-encoded binary format
// (See QVariant notes on https://doc.qt.io/qt-5/qsettings.html)
// Thankfully, newer versions use the more common font encoding.
{"general=", &result->font} {"general=", &result->font}
}); });
if (ffStrbufStartsWithC(&result->font, '@'))
{
// See QVariant notes on https://doc.qt.io/qt-5/qsettings.html and
// https://github.com/fastfetch-cli/fastfetch/issues/1053#issuecomment-2197254769
// Thankfully, newer versions use the more common font encoding.
ffStrbufSetNS(&result->font, 5, file);
}
} }
static void detectKvantum(FFQtResult* result) static void detectKvantum(FFQtResult* result)
+10 -5
View File
@@ -670,15 +670,20 @@ FFLogoImageResult ffLogoPrintImageImpl(FFLogoRequestData* requestData, const FFI
return printSuccessful ? FF_LOGO_IMAGE_RESULT_SUCCESS : FF_LOGO_IMAGE_RESULT_RUN_ERROR; return printSuccessful ? FF_LOGO_IMAGE_RESULT_SUCCESS : FF_LOGO_IMAGE_RESULT_RUN_ERROR;
} }
static int getCacheFD(FFLogoRequestData* requestData, const char* fileName) static FFNativeFD getCacheFD(FFLogoRequestData* requestData, const char* fileName)
{ {
uint32_t cacheDirLength = requestData->cacheDir.length; uint32_t cacheDirLength = requestData->cacheDir.length;
ffStrbufAppendS(&requestData->cacheDir, fileName); ffStrbufAppendS(&requestData->cacheDir, fileName);
#ifndef _WIN32
int fd = open(requestData->cacheDir.chars, O_RDONLY int fd = open(requestData->cacheDir.chars, O_RDONLY
#ifdef O_CLOEXEC #ifdef O_CLOEXEC
| O_CLOEXEC | O_CLOEXEC
#endif #endif
); );
#else
HANDLE fd = CreateFileA(requestData->cacheDir.chars, GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#endif
ffStrbufSubstrBefore(&requestData->cacheDir, cacheDirLength); ffStrbufSubstrBefore(&requestData->cacheDir, cacheDirLength);
return fd; return fd;
} }
@@ -740,17 +745,17 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
return false; return false;
} }
FF_AUTO_CLOSE_FD int fd = -1; FF_AUTO_CLOSE_FD FFNativeFD fd = FF_INVALID_FD;
if(requestData->type == FF_LOGO_TYPE_IMAGE_KITTY) if(requestData->type == FF_LOGO_TYPE_IMAGE_KITTY)
{ {
fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_COMPRESSED); fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_COMPRESSED);
if(fd == -1) if(fd == FF_INVALID_FD)
fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_UNCOMPRESSED); fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_UNCOMPRESSED);
} }
else if(requestData->type == FF_LOGO_TYPE_IMAGE_SIXEL) else if(requestData->type == FF_LOGO_TYPE_IMAGE_SIXEL)
fd = getCacheFD(requestData, FF_CACHE_FILE_SIXEL); fd = getCacheFD(requestData, FF_CACHE_FILE_SIXEL);
if(fd == -1) if(fd == FF_INVALID_FD)
return false; return false;
ffPrintCharTimes('\n', options->paddingTop); ffPrintCharTimes('\n', options->paddingTop);
@@ -783,7 +788,7 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
{ {
char buffer[32768]; char buffer[32768];
ssize_t readBytes; ssize_t readBytes;
while((readBytes = ffReadFDData(FFUnixFD2NativeFD(fd), sizeof(buffer), buffer)) > 0) while((readBytes = ffReadFDData(fd, sizeof(buffer), buffer)) > 0)
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), (size_t) readBytes, buffer); ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), (size_t) readBytes, buffer);
} }
+13 -4
View File
@@ -75,6 +75,15 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
{ {
FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate(); FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate();
ffTempsAppendNum(gpu->temperature, &tempStr, options->tempConfig, &options->moduleArgs); ffTempsAppendNum(gpu->temperature, &tempStr, options->tempConfig, &options->moduleArgs);
FF_STRBUF_AUTO_DESTROY dTotal = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY dUsed = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY sTotal = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY sUsed = ffStrbufCreate();
if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->dedicated.total, &dTotal);
if (gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->dedicated.used, &dUsed);
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_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_GPU_NUM_FORMAT_ARGS, ((FFformatarg[]) { 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->vendor, "vendor"},
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name, "name"}, {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name, "name"},
@@ -82,10 +91,10 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
{FF_FORMAT_ARG_TYPE_STRBUF, &tempStr, "temperature"}, {FF_FORMAT_ARG_TYPE_STRBUF, &tempStr, "temperature"},
{FF_FORMAT_ARG_TYPE_INT, &gpu->coreCount, "core-count"}, {FF_FORMAT_ARG_TYPE_INT, &gpu->coreCount, "core-count"},
{FF_FORMAT_ARG_TYPE_STRING, type, "type"}, {FF_FORMAT_ARG_TYPE_STRING, type, "type"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->dedicated.total, "dedicated-total"}, {FF_FORMAT_ARG_TYPE_STRBUF, &dTotal, "dedicated-total"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->dedicated.used, "dedicated-used"}, {FF_FORMAT_ARG_TYPE_STRBUF, &dUsed, "dedicated-used"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->shared.total, "shared-total"}, {FF_FORMAT_ARG_TYPE_STRBUF, &sTotal, "shared-total"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->shared.used, "shared-used"}, {FF_FORMAT_ARG_TYPE_STRBUF, &sUsed, "shared-used"},
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->platformApi, "platform-api"}, {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->platformApi, "platform-api"},
{FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->frequency, "frequency"}, {FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->frequency, "frequency"},
})); }));