From a81f89725842b2ec59995c9c9d2aaafe3c1deb69 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Mon, 8 Nov 2021 10:27:26 +0800 Subject: [PATCH 1/3] CMakeList: don't require C++ compilers --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84064f767..22dadc2b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1.0) # Threads::Threads is needed -project(fastfetch) +project(fastfetch LANGUAGES C) option(BUILD_TESTS "Build test programs" OFF) From df2ad48d13dc2d589fbea9ed648fbcc10d0b078b Mon Sep 17 00:00:00 2001 From: Carter Li Date: Mon, 8 Nov 2021 11:20:08 +0800 Subject: [PATCH 2/3] Logo: add CentOS logo --- README.md | 2 +- src/common/logo.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e30bfc82..5a2bf6e78 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ All categories not listed here should work without needing a specific implementa ##### Logos ``` -Arch, Artix, Debian, Fedora, Fedora old, Garuda, Gentoo, Manjaro, Mint, Pop!_OS, Ubuntu, Void +Arch, Artix, CentOS, Debian, Fedora, Fedora old, Garuda, Gentoo, Manjaro, Mint, Pop!_OS, Ubuntu, Void ``` > **_NOTE:_** Unknown/unsupported logos will be replaced with a question mark when running fastfetch. diff --git a/src/common/logo.c b/src/common/logo.c index 00f6af942..402754e97 100644 --- a/src/common/logo.c +++ b/src/common/logo.c @@ -348,6 +348,35 @@ static void initLogoVoid(FFinstance* instance) instance->config.logo.colors[1] = "\033[30m"; //black } +static void initLogoCentOS(FFinstance* instance) +{ + instance->config.logo.lines = + "$1 .. \n" + "$1 .PLTJ. \n" + "$1 <><><><> \n" + "$2 KKSSV' 4KKK $1LJ$4 KKKL.'VSSKK \n" + "$2 KKV' 4KKKKK $1LJ$4 KKKKAL 'VKK \n" + "$2 V' ' 'VKKKK $1LJ$4 KKKKV' ' 'V \n" + "$2 .4MA.' 'VKK $1LJ$4 KKV' '.4Mb. \n" + "$4 . $2KKKKKA.' 'V $1LJ$4 V' '.4KKKKK $3. \n" + "$4 .4D $2KKKKKKKA.'' $1LJ$4 ''.4KKKKKKK $3FA. \n" + "$4\n" + "$4 'VD $3KKKKKKKK'.. $2LJ $1..'KKKKKKKK $3FV \n" + "$4 ' $3VKKKKK'. .4 $2LJ $1K. .'KKKKKV $3' \n" + "$3 'VK'. .4KK $2LJ $1KKA. .'KV' \n" + "$3 A. . .4KKKK $2LJ $1KKKKA. . .4 \n" + "$3 KKA. 'KKKKK $2LJ $1KKKKK' .4KK \n" + "$3 KKSSA. VKKK $2LJ $1KKKV .4SSKK \n" + "$2 <><><><> \n" + "$1 'MKKM' \n" + "$1 '' "; + instance->config.logo.colors[0] = "\033[33m"; //yellow + instance->config.logo.colors[1] = "\033[32m"; //green + instance->config.logo.colors[2] = "\033[34m"; //blue + instance->config.logo.colors[3] = "\033[35m"; //magenta + instance->config.logo.colors[4] = "\033[37m"; //white +} + static bool loadLogoSet(FFinstance* instance, const char* logo) { if(instance->config.logo.freeable) @@ -391,6 +420,8 @@ static bool loadLogoSet(FFinstance* instance, const char* logo) initLogoUbuntu(instance); else if(strcasecmp(logo, "void") == 0) initLogoVoid(instance); + else if(strcasecmp(logo, "centos") == 0) + initLogoCentOS(instance); else return false; @@ -611,4 +642,3 @@ void ffPrintLogos(FFinstance* instance) } #endif - From 0c7a415f9b0d7231bff5bc8fc91aeb9882cdb074 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Mon, 8 Nov 2021 11:50:50 +0100 Subject: [PATCH 3/3] librpm: don't print error messages --- src/common/settings.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/settings.c b/src/common/settings.c index 214360d0a..81565bd30 100644 --- a/src/common/settings.c +++ b/src/common/settings.c @@ -305,6 +305,7 @@ FFvariant ffSettingsGetXFConf(FFinstance* instance, const char* channelName, con #include #include #include +#include typedef struct LibrpmData { @@ -314,9 +315,13 @@ typedef struct LibrpmData FF_LIBRARY_DEFINE_SYMBOL_FIELD(rpmdbGetIteratorCount); FF_LIBRARY_DEFINE_SYMBOL_FIELD(rpmdbFreeIterator); FF_LIBRARY_DEFINE_SYMBOL_FIELD(rpmtsFree); + FF_LIBRARY_DEFINE_SYMBOL_FIELD(rpmlogSetMask); } LibrpmData; uint32_t getRpmPackageCount(LibrpmData* data) { + // Don't print any error messages + data->ffrpmlogSetMask(RPMLOG_MASK(RPMLOG_EMERG)); + uint32_t count = 0; rpmts ts = NULL; rpmdbMatchIterator mi = NULL; @@ -359,6 +364,7 @@ uint32_t ffSettingsGetRpmPackageCount(FFinstance* instance) FF_LIBRARY_LOAD_SYMBOL_TO_OBJECT(data, library, rpmdbGetIteratorCount, mutex, 0); FF_LIBRARY_LOAD_SYMBOL_TO_OBJECT(data, library, rpmdbFreeIterator, mutex, 0); FF_LIBRARY_LOAD_SYMBOL_TO_OBJECT(data, library, rpmtsFree, mutex, 0); + FF_LIBRARY_LOAD_SYMBOL_TO_OBJECT(data, library, rpmlogSetMask, mutex, 0); pthread_mutex_unlock(&mutex); return getRpmPackageCount(&data);