From 55234ff1f39f773f1e45303581dfe085cfbf3cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 3 Jul 2023 15:38:25 +0800 Subject: [PATCH 1/8] Doc: add CI badge --- .github/workflows/{push.yml => ci.yml} | 2 +- README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) rename .github/workflows/{push.yml => ci.yml} (99%) diff --git a/.github/workflows/push.yml b/.github/workflows/ci.yml similarity index 99% rename from .github/workflows/push.yml rename to .github/workflows/ci.yml index c2bc036fe..fa2456449 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: manage pushes +name: CI on: - push diff --git a/README.md b/README.md index 151aa630f..9799e9978 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Fastfetch +[![CI](https://github.com/fastfetch-cli/fastfetch/actions/workflows/ci.yml/badge.svg)](https://github.com/fastfetch-cli/fastfetch/actions/workflows/ci.yml) + Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying them in a pretty way. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, MacOS and Windows 7+ are supported. From 1f5da2736e6e832a337cdceac0af106a91be8fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 3 Jul 2023 18:19:41 +0800 Subject: [PATCH 2/8] Terminal (Linux): support terminator version detection --- src/detection/terminalshell/terminalshell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 7a72faff8..e3a5fa87c 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -267,6 +267,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe if(ffStrbufIgnCaseEqualS(processName, "xfce4-terminal")) return getExeVersionGeneral(exe, version);//xfce4-terminal 1.0.4 (Xfce 4.18)... + if(ffStrbufIgnCaseEqualS(processName, "terminator")) + return getExeVersionGeneral(exe, version);//terminator 2.1.3 + if(ffStrbufIgnCaseEqualS(processName, "deepin-terminal")) return getExeVersionGeneral(exe, version);//deepin-terminal 5.4.36 From 482b15c62e72fb77a4b2125c485236b78ca108e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 3 Jul 2023 23:18:36 +0800 Subject: [PATCH 3/8] Packages (Linux): try detecting pkgtool fix #486 --- CHANGELOG.md | 6 +++++- README.md | 2 +- presets/verbose | 2 +- src/detection/packages/packages.h | 1 + src/detection/packages/packages_linux.c | 1 + src/fastfetch.c | 5 +++-- src/modules/packages.c | 1 + 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e156e63c..c6306a454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ +# 1.12.2 + +Features: +* Support `pkgtool` package manager detection (Linux, Packages) + # 1.12.1 Bugfixes: - * Fix compiling error on Apple Slicon (Bios, macOS) # 1.12.0 diff --git a/README.md b/README.md index 9799e9978..a8593d138 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, CRUX, C ##### Package managers ``` -apk, brew, Chocolatey, dpkg, emerge, eopkg, Flatpak, MacPorts, nix, Pacman, pkg, rpm, scoop, Snap, xbps +apk, brew, Chocolatey, dpkg, emerge, eopkg, Flatpak, MacPorts, nix, Pacman, pkg, pkgtool, rpm, scoop, Snap, xbps ``` ##### WM themes diff --git a/presets/verbose b/presets/verbose index 78314b7b3..6a9239728 100644 --- a/presets/verbose +++ b/presets/verbose @@ -3,7 +3,7 @@ --kernel-format Sysname: {}; Release: {}; Version: {} --uptime-format Days: {}; Hours: {}; Minutes: {}; Seconds: {} --processes-format Count: {} ---packages-format All: {}; pacman: {}; pacman branch: {}; dpkg: {}; rpm: {}; emerge: {}; eopkg: {}; xbps: {}; apk: {}; flatpak-system: {}; flatpak-user: {}; snap: {}; brew: {}; brew-cask: {}; port: {}; scoop: {}; choco: {} +--packages-format All: {}; pacman: {}; pacman branch: {}; dpkg: {}; rpm: {}; emerge: {}; eopkg: {}; xbps: {}; apk: {}; flatpak-system: {}; flatpak-user: {}; snap: {}; brew: {}; brew-cask: {}; port: {}; scoop: {}; choco: {}; pkgtool: {} --shell-format Process name: {}; Process path: {}; Process exe: {}; Process version: {}; User path: {}; User exe: {}; User version: {} --display-format Width: {}; Height: {}; Refresh rate: {}; ScaledWith: {}; ScaledHeight: {} --de-format Process name: {}; Pretty name: {}; Version: {} diff --git a/src/detection/packages/packages.h b/src/detection/packages/packages.h index 5d806a238..9b6206574 100644 --- a/src/detection/packages/packages.h +++ b/src/detection/packages/packages.h @@ -21,6 +21,7 @@ typedef struct FFPackagesResult uint32_t nixUser; uint32_t pacman; uint32_t pkg; + uint32_t pkgtool; uint32_t port; uint32_t rpm; uint32_t scoop; diff --git a/src/detection/packages/packages_linux.c b/src/detection/packages/packages_linux.c index 4ec9ac043..60ea05de3 100644 --- a/src/detection/packages/packages_linux.c +++ b/src/detection/packages/packages_linux.c @@ -276,6 +276,7 @@ static void getPackageCounts(const FFinstance* instance, FFstrbuf* baseDir, FFPa packageCounts->nixSystem += getNixPackages(baseDir, "/run/current-system"); packageCounts->pacman += getNumElements(baseDir, "/var/lib/pacman/local", DT_DIR); packageCounts->pkg += getSQLite3Int(instance, baseDir, "/var/db/pkg/local.sqlite", "SELECT count(id) FROM packages"); + packageCounts->pkgtool += getNumElements(baseDir, "/var/log/packages", DT_REG); packageCounts->rpm += getSQLite3Int(instance, baseDir, "/var/lib/rpm/rpmdb.sqlite", "SELECT count(blob) FROM Packages"); packageCounts->snap += getSnap(baseDir); packageCounts->xbps += getXBPS(baseDir, "/var/db/xbps"); diff --git a/src/fastfetch.c b/src/fastfetch.c index 63480f514..687eacea0 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -139,7 +139,7 @@ static inline void printCommandHelp(const char* command) } else if(strcasecmp(command, "packages-format") == 0) { - constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (eopkg), {8} (xbps), {9} (nix-system), {10} (nix-user), {11} (nix-default), {12} (apk), {13} (pkg), {14} (flatpak-system), {15} (flatpack-user), {16} (snap), {17} (brew), {18} (brew-cask), {19} (port), {20} (scoop), {21} (choco)", 21, + constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (eopkg), {8} (xbps), {9} (nix-system), {10} (nix-user), {11} (nix-default), {12} (apk), {13} (pkg), {14} (flatpak-system), {15} (flatpack-user), {16} (snap), {17} (brew), {18} (brew-cask), {19} (port), {20} (scoop), {21} (choco), {22} (pkgtool)", 22, "Number of all packages", "Number of pacman packages", "Pacman branch on manjaro", @@ -160,7 +160,8 @@ static inline void printCommandHelp(const char* command) "Number of brew-cask packages", "Number of macports packages", "Number of scoop packages", - "Number of choco packages" + "Number of choco packages", + "Number of pkgtool packages" ); } else if(strcasecmp(command, "shell-format") == 0) diff --git a/src/modules/packages.c b/src/modules/packages.c index a869fa678..80ce00d91 100644 --- a/src/modules/packages.c +++ b/src/modules/packages.c @@ -57,6 +57,7 @@ void ffPrintPackages(FFinstance* instance) FF_PRINT_PACKAGE(port) FF_PRINT_PACKAGE(scoop) FF_PRINT_PACKAGE(choco) + FF_PRINT_PACKAGE(pkgtool) //Fix linter warning of unused value of all (void) all; From 085479a92344fab30a693ba62d1e3f2403703a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 4 Jul 2023 18:00:50 +0800 Subject: [PATCH 4/8] Shell (Windows): fallback shell version detection to file version --- src/detection/terminalshell/terminalshell.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index e3a5fa87c..494612bff 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -121,11 +121,6 @@ static bool getShellVersionWinPowerShell(FFstrbuf* exe, FFstrbuf* version) ffStrbufSubstrAfterLastC(version, ' '); return true; } - -static bool getShellVersionCmd(FFstrbuf* exe, FFstrbuf* version) -{ - return getFileVersion(exe->chars, version); -} #endif bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version) @@ -151,11 +146,11 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version) #ifdef _WIN32 if(strcasecmp(exeName, "powershell") == 0 || strcasecmp(exeName, "powershell_ise") == 0) return getShellVersionWinPowerShell(exe, version); - if(strcasecmp(exeName, "cmd") == 0) - return getShellVersionCmd(exe, version); - #endif + return getFileVersion(exe->chars, version); + #else return false; + #endif } FF_MAYBE_UNUSED static bool getTerminalVersionTermux(FFstrbuf* version) From 03efbe5f6aaffa3c5a700d62ec4c9ea8ce922d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 4 Jul 2023 18:32:02 +0800 Subject: [PATCH 5/8] TerminalShell (Windows): fix #488 --- src/detection/terminalshell/terminalshell_windows.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index 9af70f8ca..580252f76 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -142,7 +142,8 @@ static uint32_t getShellInfo(const FFinstance* instance, FFTerminalShellResult* ffStrbufIgnCaseEqualS(&result->shellPrettyName, "guake-wrapped") || ffStrbufIgnCaseEqualS(&result->shellPrettyName, "fastfetch") || //scoop warps the real binaries with a "shim" exe ffStrbufIgnCaseEqualS(&result->shellPrettyName, "flashfetch") || - ffStrbufContainIgnCaseS(&result->shellPrettyName, "debug") + ffStrbufContainIgnCaseS(&result->shellPrettyName, "debug") || + ffStrbufStartsWithIgnCaseS(&result->shellPrettyName, "ConEmuC") // https://github.com/fastfetch-cli/fastfetch/issues/488#issuecomment-1619982014 ) { ffStrbufClear(&result->shellProcessName); ffStrbufClear(&result->shellPrettyName); From f74c643a845313ea5c5201acaa51f4a8e5b32ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 5 Jul 2023 08:40:50 +0800 Subject: [PATCH 6/8] Host (macOS): fix incorrect Host on M2 Mac Studio with M2 Max CPU (#490) --- src/detection/host/host_apple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/host/host_apple.c b/src/detection/host/host_apple.c index b696f9a7d..9814f5700 100644 --- a/src/detection/host/host_apple.c +++ b/src/detection/host/host_apple.c @@ -113,8 +113,8 @@ static const char* getProductName(const FFstrbuf* hwModel) { const char* version = hwModel->chars + strlen("Mac"); if(strEqual(version, "14,15")) return "MacBook Air (15-inch, M2, 2023)"; - if(strEqual(version, "14,14")) return "Mac Studio (M2 Max, 2023, Two USB-C front ports)"; - if(strEqual(version, "14,13")) return "Mac Studio (M2 Ultra, 2023, Two Thunderbolt 4 front ports)"; + if(strEqual(version, "14,14")) return "Mac Studio (M2 Ultra, 2023, Two Thunderbolt 4 front ports)"; + if(strEqual(version, "14,13")) return "Mac Studio (M2 Max, 2023, Two USB-C front ports)"; if(strEqual(version, "14,8")) return "Mac Pro (2023)"; if(strEqual(version, "14,6") || strEqual(version, "14,10")) return "MacBook Pro (16-inch, 2023)"; From ee90d886ab8ab7e581b681513060a93018617d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 5 Jul 2023 09:43:52 +0800 Subject: [PATCH 7/8] Packages (Linux): print pkgtool package count in custom module format mode --- src/modules/packages.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/packages.c b/src/modules/packages.c index 80ce00d91..a7e5d60b9 100644 --- a/src/modules/packages.c +++ b/src/modules/packages.c @@ -3,7 +3,7 @@ #include "detection/packages/packages.h" #define FF_PACKAGES_MODULE_NAME "Packages" -#define FF_PACKAGES_NUM_FORMAT_ARGS 21 +#define FF_PACKAGES_NUM_FORMAT_ARGS 22 void ffPrintPackages(FFinstance* instance) { @@ -88,6 +88,7 @@ void ffPrintPackages(FFinstance* instance) {FF_FORMAT_ARG_TYPE_UINT, &counts->port}, {FF_FORMAT_ARG_TYPE_UINT, &counts->scoop}, {FF_FORMAT_ARG_TYPE_UINT, &counts->choco}, + {FF_FORMAT_ARG_TYPE_UINT, &counts->pkgtool}, }); } } From 948a480859c5f86c77d29b67315407fa4b6a16e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 5 Jul 2023 09:44:44 +0800 Subject: [PATCH 8/8] Release: v1.12.2 --- CHANGELOG.md | 6 ++++++ CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6306a454..35abb7038 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ # 1.12.2 Features: +* Support terminator terminal version detection (Linux, Terminal) * Support `pkgtool` package manager detection (Linux, Packages) +* Support `Far` shell version detection (Windows, Shell) + +Bugfixes: +* Fix ConEmu terminal detection in some special cases (Windows, Terminal, #488) +* Fix incorrect Host on M2 Mac Studio with M2 Max CPU (macOS, Host, #490) # 1.12.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 256eb7921..870be383b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 1.12.1 + VERSION 1.12.2 LANGUAGES C DESCRIPTION "Fast system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"