Compare commits

...

9 Commits

Author SHA1 Message Date
Carter Li b001ea409b Merge pull request #1056 from fastfetch-cli/dev
Release: v2.17.1
2024-06-29 08:20:39 +08:00
李通洲 f97a9fdfc0 GPU: don't print 16 EiB 2024-06-29 07:55:01 +08:00
李通洲 2c8d5292d7 Release: v2.17.1 2024-06-29 07:29:53 +08:00
李通洲 88e4579f1e Fastfetch: fix segfaults with --show-errors and an invalid module
Fix #1055
2024-06-29 07:16:35 +08:00
Carlos & 8f97e61f67 Theme (QT): ignore QVariant format (#1054)
Closes: #1053

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-06-29 07:14:36 +08:00
李通洲 0b943bb25e GPU: print formatted size when --gpu-format is used
Fix #1052
2024-06-28 22:24:02 +08:00
李通洲 19590003e1 GPU: guard GPU frequency behind driverSpecific 2024-06-28 22:17:37 +08:00
李通洲 27a1d9f8c6 Logo (Image): fix building on Windows 2024-06-28 18:08:16 +08:00
李通洲 d50ebc86c7 CMake (Windows): don't generate libffwinrt.dll.a 2024-06-28 15:15:49 +08:00
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
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
project(fastfetch
VERSION 2.17.0
VERSION 2.17.1
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -1156,7 +1156,7 @@ if(WIN32)
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" 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_compile_definitions(ffwinrt PRIVATE WIN32_LEAN_AND_MEAN=1 WINRT_LEAN_AND_MEAN=1)
target_link_options(ffwinrt
+2
View File
@@ -8,11 +8,13 @@
#include <handleapi.h>
#include <io.h>
typedef HANDLE FFNativeFD;
#define FF_INVALID_FD INVALID_HANDLE_VALUE
#else
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
typedef int FFNativeFD;
#define FF_INVALID_FD (-1)
// 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
// 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)
{
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
if (moduleArgs->outputColor.length)
if (moduleArgs && moduleArgs->outputColor.length)
ffPrintColor(&moduleArgs->outputColor);
else if (instance.config.display.colorOutput.length)
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,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type,
.frequency = &gpu->frequency,
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
}, "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,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type,
.frequency = &gpu->frequency,
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
},
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,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type,
.frequency = &gpu->frequency,
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
}, "/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[]) {
{"style=", &result->widgetStyle},
{"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}
});
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)
+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;
}
static int getCacheFD(FFLogoRequestData* requestData, const char* fileName)
static FFNativeFD getCacheFD(FFLogoRequestData* requestData, const char* fileName)
{
uint32_t cacheDirLength = requestData->cacheDir.length;
ffStrbufAppendS(&requestData->cacheDir, fileName);
#ifndef _WIN32
int fd = open(requestData->cacheDir.chars, O_RDONLY
#ifdef O_CLOEXEC
| O_CLOEXEC
#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);
return fd;
}
@@ -740,17 +745,17 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
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)
{
fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_COMPRESSED);
if(fd == -1)
if(fd == FF_INVALID_FD)
fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_UNCOMPRESSED);
}
else if(requestData->type == FF_LOGO_TYPE_IMAGE_SIXEL)
fd = getCacheFD(requestData, FF_CACHE_FILE_SIXEL);
if(fd == -1)
if(fd == FF_INVALID_FD)
return false;
ffPrintCharTimes('\n', options->paddingTop);
@@ -783,7 +788,7 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
{
char buffer[32768];
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);
}
+13 -4
View File
@@ -75,6 +75,15 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
{
FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate();
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_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor, "vendor"},
{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_INT, &gpu->coreCount, "core-count"},
{FF_FORMAT_ARG_TYPE_STRING, type, "type"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->dedicated.total, "dedicated-total"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->dedicated.used, "dedicated-used"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->shared.total, "shared-total"},
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->shared.used, "shared-used"},
{FF_FORMAT_ARG_TYPE_STRBUF, &dTotal, "dedicated-total"},
{FF_FORMAT_ARG_TYPE_STRBUF, &dUsed, "dedicated-used"},
{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"},
}));