From ed69a7059b4a320500929b24383ab07b721dc3fd Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 14 May 2025 09:51:12 +0800 Subject: [PATCH 01/14] Packaging: update debian stuff [ci skip] --- debian/changelog | 6 ++++++ debian/files | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9a06e87918..b42192fbdb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +fastfetch (2.43.0) jammy; urgency=medium + + * Update to 2.43.0 + + -- Carter Li Wed, 14 May 2025 09:49:50 +0800 + fastfetch (2.42.0) jammy; urgency=medium * Update to 2.42.0 diff --git a/debian/files b/debian/files index e8edf7d8f3..0a32d4a5d2 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -fastfetch_2.42.0_source.buildinfo universe/utils optional +fastfetch_2.43.0_source.buildinfo universe/utils optional From c054570308528c34f354990f2b5855e317e4738a Mon Sep 17 00:00:00 2001 From: "Md. Iftakhar Awal Chowdhury" <42291930+AtifChy@users.noreply.github.com> Date: Thu, 15 May 2025 14:18:19 +0600 Subject: [PATCH 02/14] fish complete: add `--logo-color-[1-9]` completion (#1754) * fish complete: add `--logo-color-[1-9]` completion * reverted unnecessary changes --- completions/fastfetch.fish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/completions/fastfetch.fish b/completions/fastfetch.fish index 7badab3881..f4804f5f50 100755 --- a/completions/fastfetch.fish +++ b/completions/fastfetch.fish @@ -62,11 +62,17 @@ end echo ' import json, subprocess, sys + def main(): data: dict[str, list[dict]] = json.loads(subprocess.check_output(["fastfetch", "--help-raw"])) for key in data: for flag in data[key]: + if flag["long"] == "logo-color-[1-9]": + for i in range(1, 10): + print(f"""complete -c fastfetch -d "{flag["desc"]}" -l "logo-color-{i}" -x -a "(__fastfetch_complete_color)" """) + continue + if flag.get("pseudo", False): continue @@ -75,7 +81,7 @@ def main(): command_prefix += f""" -o {flag["short"]}""" if "arg" in flag: - type: str = flag["arg"]["type"]; + type: str = flag["arg"]["type"] if type == "bool": print(f"{command_prefix} -x -a \"(__fastfetch_complete_bool)\"") elif type == "color": @@ -98,6 +104,7 @@ def main(): else: print(f"{command_prefix} -f") + if __name__ == "__main__": try: main() From 839abab744cc5be7b3a7e3cc015efbd50c145f66 Mon Sep 17 00:00:00 2001 From: Collin <104375741+qtqgyt@users.noreply.github.com> Date: Thu, 15 May 2025 18:58:36 -0600 Subject: [PATCH 03/14] Doc: Add information of where to find example config files (#1759) [ci skip] --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 079ffaa7b9..6e413021ec 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for +According configuration files for examples are located [here](https://github.com/fastfetch-cli/fastfetch/tree/dev/presets/examples). + There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki). ## Installation From 9a54d92e9f1b6b300e63768112cb5ddc887c2763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 16 May 2025 10:33:33 +0800 Subject: [PATCH 04/14] Stat: use `ESC 7/8` instead of `CSI s/u` Fix Apple Terminal compatibility #1755 --- src/common/commandoption.c | 2 +- src/common/jsonconfig.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/commandoption.c b/src/common/commandoption.c index 01335a1ffe..d91072928e 100644 --- a/src/common/commandoption.c +++ b/src/common/commandoption.c @@ -134,7 +134,7 @@ void ffPrintCommandOption(FFdata* data, yyjson_mut_doc* jsonDoc) int len = snprintf(str, sizeof str, "%.3fms", ms); if (thres > 0) snprintf(str, sizeof str, "\e[%sm%.3fms\e[m", (ms <= thres ? FF_COLOR_FG_GREEN : ms <= 2 * thres ? FF_COLOR_FG_YELLOW : FF_COLOR_FG_RED), ms); - printf("\e[s\e[1A\e[9999999C\e[%dD%s\e[u", len, str); // Save; Up 1; Right 9999999; Left ; Print ; Load + printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len, str); // Save; Up 1; Right 9999999; Left ; Print ; Load } } diff --git a/src/common/jsonconfig.c b/src/common/jsonconfig.c index 5732e33b35..6170f31e52 100644 --- a/src/common/jsonconfig.c +++ b/src/common/jsonconfig.c @@ -224,7 +224,7 @@ static const char* printJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc) int len = snprintf(str, sizeof str, "%.3fms", ms); if (thres > 0) snprintf(str, sizeof str, "\e[%sm%.3fms\e[m", (ms <= thres ? FF_COLOR_FG_GREEN : ms <= 2 * thres ? FF_COLOR_FG_YELLOW : FF_COLOR_FG_RED), ms); - printf("\e[s\e[1A\e[9999999C\e[%dD%s\e[u", len, str); // Save; Up 1; Right 9999999; Left ; Print ; Load + printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len, str); // Save; Up 1; Right 9999999; Left ; Print ; Load } } From 2d938042d01cdda68b09dbfacdd220d232cd0a11 Mon Sep 17 00:00:00 2001 From: Xavier Xiong Date: Fri, 16 May 2025 14:05:42 +0800 Subject: [PATCH 05/14] Logo (Builtin): Add Kylin Logo (Remove ANSI codes) (#1760) * Logo (Builtin): Add Kylin Logo * Remove all ANSI escape codes from ASCII Logo * Add color prefix to kylin logo --- src/logo/ascii/kylin.txt | 22 ++++++++++++++++++++++ src/logo/builtin.c | 13 +++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/logo/ascii/kylin.txt diff --git a/src/logo/ascii/kylin.txt b/src/logo/ascii/kylin.txt new file mode 100644 index 0000000000..f71dc7b224 --- /dev/null +++ b/src/logo/ascii/kylin.txt @@ -0,0 +1,22 @@ + $1++ + $2* *** + $2******* + $2*******$1++ + $2********$1+$3=== + $2******$1#$2*$1+$3====== + $2*******$1#$2***$1++$3=== + $2*********$1+$2**$3=== + $1##$2*********$1##$3== $3====$1+ +$4%$1##$2****$1++$3==$1+$2****$1# $2***$1+$3=$2** +$1#$2****$1++$3=====$1++$2****$1## $2******** +$1####$2*$1+$3=======$1+$2******$3===$1- $2***$1#$2*$1##$2**** + $1#$4%$1#$2******$1+$2**$1+$3==$1++$2**$3=======$1+$2*$1+$2*$1#$4% + $4%$1#$2****$1+$2******$3=====$1+$3====$1+++$3==$2** + $1#$2*********$1##$2***$1###$2********$1##$4% + $2***$1##$4%$1#$4%%%%$2*****$1#$2*$1###$2*****$1#$4% + $2*$1#$4%%%$1#$4%%%%%$2**** $4%%$2*******$1#$4% + $1#$4%%%%%% $4%%%$1##$2***$1###$4%% + $2**$1#$4% $4%%%%$1#$4% $2**$1#$2**$1## + $1###$4%% $4%%%%%$1 $4%%%$2*** + $4%%%%%% $4%%%%%%%$1 $4%%%%$1#$2* + $4%%%%%% $4%%%%%%$1+$3= \ No newline at end of file diff --git a/src/logo/builtin.c b/src/logo/builtin.c index 5132c12c1d..87b45db8d6 100644 --- a/src/logo/builtin.c +++ b/src/logo/builtin.c @@ -2516,6 +2516,19 @@ static const FFlogo K[] = { .colorKeys = FF_COLOR_FG_BLUE, .colorTitle = FF_COLOR_FG_BLUE, }, + // Kylin + { + .names = {"Kylin", "kylin"}, + .lines = FASTFETCH_DATATEXT_LOGO_KYLIN, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_CYAN, + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK + }, + .colorKeys = FF_COLOR_FG_BLUE, + .colorTitle = FF_COLOR_FG_BLUE, + }, // LAST {}, }; From 768238cb46a6764d656a511643f15db641f3f9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 17 May 2025 18:02:19 +0800 Subject: [PATCH 06/14] TerminalShell (Linux): ignore `script` Fix #1761 --- src/detection/terminalshell/terminalshell_linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index ae5eaf77c8..b09cb0a3c9 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -55,9 +55,10 @@ static pid_t getShellInfo(FFShellResult* result, pid_t pid) ffStrbufEqualS(&result->processName, "valgrind") || ffStrbufEqualS(&result->processName, "fastfetch") || //994 ffStrbufEqualS(&result->processName, "flashfetch") || + ffStrbufEqualS(&result->processName, "proot") || + ffStrbufEqualS(&result->processName, "script") || ffStrbufContainS(&result->processName, "debug") || ffStrbufContainS(&result->processName, "command-not-") || - ffStrbufEqualS(&result->processName, "proot") || ffStrbufEndsWithS(&result->processName, ".sh") ) { @@ -107,6 +108,7 @@ static pid_t getTerminalInfo(FFTerminalResult* result, pid_t pid) ffStrbufEqualS(&result->processName, "clifm") || // https://github.com/leo-arch/clifm/issues/289 ffStrbufEqualS(&result->processName, "chezmoi") || // #762 ffStrbufEqualS(&result->processName, "proot") || + ffStrbufEqualS(&result->processName, "script") || #ifdef __linux__ ffStrbufStartsWithS(&result->processName, "flatpak-") || // #707 #endif From 526868e35573421bd80d73f7f1d1dd85f81a28a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 19 May 2025 15:25:06 +0800 Subject: [PATCH 07/14] Disk (Linux): don't hard code hidden mount points --- src/detection/disk/disk_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index e67304ac40..e7ee2e9c9a 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -220,7 +220,7 @@ static bool isRemovable(FFDisk* currentDisk) static void detectType(const FFlist* disks, FFDisk* currentDisk, struct mntent* device) { - if(ffStrbufStartsWithS(¤tDisk->mountpoint, "/boot") || ffStrbufStartsWithS(¤tDisk->mountpoint, "/efi")) + if(hasmntopt(device, "x-gvfs-hide") || hasmntopt(device, "hidden")) currentDisk->type = FF_DISK_VOLUME_TYPE_HIDDEN_BIT; else if(isSubvolume(disks, currentDisk)) currentDisk->type = FF_DISK_VOLUME_TYPE_SUBVOLUME_BIT; From 8eb8f710d0d93e84b439e7204120de93280c84ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 19 May 2025 16:42:11 +0800 Subject: [PATCH 08/14] Disk: add option `--disk-hidden-folders` --- src/detection/disk/disk.c | 17 +++++++++++++---- src/detection/disk/disk.h | 2 +- src/detection/disk/disk_bsd.c | 2 +- src/detection/disk/disk_haiku.cpp | 2 +- src/detection/disk/disk_linux.c | 2 +- src/detection/disk/disk_sunos.c | 2 +- src/detection/disk/disk_windows.c | 2 +- src/modules/disk/disk.c | 17 +++++++++++++++++ src/modules/disk/option.h | 1 + 9 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/detection/disk/disk.c b/src/detection/disk/disk.c index 21520b5321..39c0920e57 100644 --- a/src/detection/disk/disk.c +++ b/src/detection/disk/disk.c @@ -1,6 +1,6 @@ #include "disk.h" -bool ffDiskMatchMountpoint(FFDiskOptions* options, const char* mountpoint) +bool ffDiskMatchMountpoint(FFstrbuf* folders, const char* mountpoint) { #ifdef _WIN32 const char separator = ';'; @@ -11,12 +11,12 @@ bool ffDiskMatchMountpoint(FFDiskOptions* options, const char* mountpoint) uint32_t mountpointLength = (uint32_t) strlen(mountpoint); uint32_t startIndex = 0; - while(startIndex < options->folders.length) + while(startIndex < folders->length) { - uint32_t colonIndex = ffStrbufNextIndexC(&options->folders, startIndex, separator); + uint32_t colonIndex = ffStrbufNextIndexC(folders, startIndex, separator); uint32_t folderLength = colonIndex - startIndex; - if (folderLength == mountpointLength && memcmp(options->folders.chars + startIndex, mountpoint, mountpointLength) == 0) + if (folderLength == mountpointLength && memcmp(folders->chars + startIndex, mountpoint, mountpointLength) == 0) return true; startIndex = colonIndex + 1; @@ -54,5 +54,14 @@ const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks) } } + if (options->hiddenFolders.length) + { + FF_LIST_FOR_EACH(FFDisk, disk, *disks) + { + if (ffDiskMatchMountpoint(&options->hiddenFolders, disk->mountpoint.chars)) + disk->type |= FF_DISK_VOLUME_TYPE_HIDDEN_BIT; + } + } + return NULL; } diff --git a/src/detection/disk/disk.h b/src/detection/disk/disk.h index 1700c6078d..4a24f9de05 100644 --- a/src/detection/disk/disk.h +++ b/src/detection/disk/disk.h @@ -28,4 +28,4 @@ typedef struct FFDisk const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks /* list of FFDisk */); const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks); -bool ffDiskMatchMountpoint(FFDiskOptions* options, const char* mountpoint); +bool ffDiskMatchMountpoint(FFstrbuf* folders, const char* mountpoint); diff --git a/src/detection/disk/disk_bsd.c b/src/detection/disk/disk_bsd.c index ca6fe1bcca..f2964234a9 100644 --- a/src/detection/disk/disk_bsd.c +++ b/src/detection/disk/disk_bsd.c @@ -145,7 +145,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks) { if(__builtin_expect(options->folders.length > 0, 0)) { - if(!ffDiskMatchMountpoint(options, fs->f_mntonname)) + if(!ffDiskMatchMountpoint(&options->folders, fs->f_mntonname)) continue; } else if(!ffStrEquals(fs->f_mntonname, "/") && !ffStrStartsWith(fs->f_mntfromname, "/dev/") && !ffStrEquals(fs->f_fstypename, "zfs")) diff --git a/src/detection/disk/disk_haiku.cpp b/src/detection/disk/disk_haiku.cpp index a8e9346756..6bf2169229 100644 --- a/src/detection/disk/disk_haiku.cpp +++ b/src/detection/disk/disk_haiku.cpp @@ -23,7 +23,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks) if (__builtin_expect(options->folders.length, 0)) { - if (!ffDiskMatchMountpoint(options, path.Path())) + if (!ffDiskMatchMountpoint(&options->folders, path.Path())) continue; } diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index e7ee2e9c9a..6fb7ed6c5b 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -281,7 +281,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks) { if (__builtin_expect(options->folders.length, 0)) { - if (!ffDiskMatchMountpoint(options, device->mnt_dir)) + if (!ffDiskMatchMountpoint(&options->folders, device->mnt_dir)) continue; } else if(!isPhysicalDevice(device)) diff --git a/src/detection/disk/disk_sunos.c b/src/detection/disk/disk_sunos.c index 82cba50ce7..d52a5e9075 100644 --- a/src/detection/disk/disk_sunos.c +++ b/src/detection/disk/disk_sunos.c @@ -113,7 +113,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks) { if (__builtin_expect(options->folders.length, 0)) { - if (!ffDiskMatchMountpoint(options, device.mnt_mountp)) + if (!ffDiskMatchMountpoint(&options->folders, device.mnt_mountp)) continue; } else if(!isPhysicalDevice(&device)) diff --git a/src/detection/disk/disk_windows.c b/src/detection/disk/disk_windows.c index 48c595ca02..e8955908b8 100644 --- a/src/detection/disk/disk_windows.c +++ b/src/detection/disk/disk_windows.c @@ -47,7 +47,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks) if (__builtin_expect((long) options->folders.length, 0)) { - if (!ffDiskMatchMountpoint(options, buffer.chars)) + if (!ffDiskMatchMountpoint(&options->folders, buffer.chars)) continue; } else if(driveType == DRIVE_NO_ROOT_DIR) diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index 68d0a89aec..4925a9576b 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -205,6 +205,12 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch return true; } + if (ffStrEqualsIgnCase(subKey, "hidden-folders")) + { + ffOptionParseString(key, value, &options->hiddenFolders); + return true; + } + if (ffStrEqualsIgnCase(subKey, "show-regular")) { if (ffOptionParseBoolean(value)) @@ -293,6 +299,12 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module) continue; } + if (ffStrEqualsIgnCase(key, "hiddenFolders")) + { + ffStrbufSetS(&options->hiddenFolders, yyjson_get_str(val)); + continue; + } + if (ffStrEqualsIgnCase(key, "showExternal")) { if (yyjson_get_bool(val)) @@ -496,6 +508,11 @@ void ffInitDiskOptions(FFDiskOptions* options) ffOptionInitModuleArg(&options->moduleArgs, ""); ffStrbufInit(&options->folders); + #if _WIN32 || __APPLE__ || __ANDROID__ + ffStrbufInit(&options->hiddenFolders); + #else + ffStrbufInitStatic(&options->hiddenFolders, "/efi:/boot:/boot/efi"); + #endif options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT; options->calcType = FF_DISK_CALC_TYPE_FREE; options->percent = (FFPercentageModuleConfig) { 50, 80, 0 }; diff --git a/src/modules/disk/option.h b/src/modules/disk/option.h index eb2323f4cd..54573f2c33 100644 --- a/src/modules/disk/option.h +++ b/src/modules/disk/option.h @@ -29,6 +29,7 @@ typedef struct FFDiskOptions FFModuleArgs moduleArgs; FFstrbuf folders; + FFstrbuf hiddenFolders; FFDiskVolumeType showTypes; FFDiskCalcType calcType; FFPercentageModuleConfig percent; From a993a6f1268801163b29cab2683f08c10f1e8bad Mon Sep 17 00:00:00 2001 From: asmeron <52819612+asmeron@users.noreply.github.com> Date: Wed, 21 May 2025 08:50:34 +0600 Subject: [PATCH 09/14] Logo (Builtin): Add UBLinux Logo (#1764) * Logo (Builtin): Add UBLinux Logo * Update builtin.c --------- Co-authored-by: asmeron Co-authored-by: Carter Li --- src/logo/ascii/ublinux.txt | 19 +++++++++++++++++++ src/logo/ascii/ublinux_small.txt | 11 +++++++++++ src/logo/builtin.c | 25 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 src/logo/ascii/ublinux.txt create mode 100644 src/logo/ascii/ublinux_small.txt diff --git a/src/logo/ascii/ublinux.txt b/src/logo/ascii/ublinux.txt new file mode 100644 index 0000000000..7e9a9e3bee --- /dev/null +++ b/src/logo/ascii/ublinux.txt @@ -0,0 +1,19 @@ +$1 UUU +$1 UUUUUUUUUUU +$1 UUUUUUUUUUUUUUUUU +$1 UUUUUUUUUUUUUUUUUUUUUUUUU +$1UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU$3#. +$1UU$2BBBBB$1UUUUUU$2BBBBBBBBBBB.$1UUUUUU$3## +$1UU$2BBBBB$1UUUUUU$2BBBBBBBBBBBBB:$1UUUU$3## +$1UU$2BBBBB$1UUUUUU$2BBBBB$1UUUU$2BBBBB$1UUUU$3## +$1UU$2BBBBB$1UUUUUU$2BBBBB$1UUUU$2BBBBB$1UUUU$3## +$1UU$2BBBBB$1UUUUUU$2BBBBBBBBBBBB$1UUUUUU$3## +$1UU$2BBBBB$1UUUUUU$2BBBBB$1UUUU,$2BBBB.$1UUU$3## +$1UUU$2BBBBB$1UUUUU$2BBBBB$1UUUUU$2BBBBB$1UUU$3## +$1UUU$2BBBBB$1UUUUU$2BBBBB$1UUUUU$2BBBBB$1UUU$3## +$1UUU#$2BBBBBBBBBBBBBBBBBBBBBBB$1UUUU$3## +$1UUUUUU$2'BBBBBBBBBBBBBBBB'$1UUUUUUU$3## +$1 UUUUUUUUUUUUUUUUUUUUUUUUU$3##' +$1 UUUUUUUUUUUUUUUUU$3###' +$1 UUUUUUUUUUU$3###' +$1 UUU$3###' diff --git a/src/logo/ascii/ublinux_small.txt b/src/logo/ascii/ublinux_small.txt new file mode 100644 index 0000000000..4b9424941a --- /dev/null +++ b/src/logo/ascii/ublinux_small.txt @@ -0,0 +1,11 @@ +$1 UUUU +$1 UUUUUUUUUU +$1 $2BBB$1UUUU$2BBBBBB$1UU$3# +$1U$2BBB$1UUUU$2BBB$1UUU$2B$1UU$3# +$1U$2BBB$1UUUU$2BBB$1UUU$2B$1UU$3# +$1U$2BBB$1UUUU$2BBBBBB$1UUU$3# +$1U$2BBB$1UUUU$2BBB$1UUU$2BB$1U$3# +$1UU$2BBB$1UUU$2BBB$1UUU$2BB$1U$3# +$1 UU$2BBBBBBBBBBB$1UU$3# +$1 UUUUUUUUU$3# +$1 UUU$3# diff --git a/src/logo/builtin.c b/src/logo/builtin.c index 87b45db8d6..0401f58438 100644 --- a/src/logo/builtin.c +++ b/src/logo/builtin.c @@ -4735,6 +4735,31 @@ static const FFlogo T[] = { }; static const FFlogo U[] = { + // UBLinux + { + .names = {"UBLinux"}, + .lines = FASTFETCH_DATATEXT_LOGO_UBLINUX, + .colors = { + FF_COLOR_FG_256 "38", + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_256 "38", + .colorTitle = FF_COLOR_FG_WHITE, + }, + // UBLinuxSmall + { + .names = {"UBLinux_small"}, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_UBLINUX_SMALL, + .colors = { + FF_COLOR_FG_256 "38", + FF_COLOR_FG_WHITE, + FF_COLOR_FG_LIGHT_BLACK, + }, + .colorKeys = FF_COLOR_FG_256 "38", + .colorTitle = FF_COLOR_FG_WHITE, + }, // Ubuntu { .names = {"ubuntu", "ubuntu-linux"}, From e2a714732a0666651fc6d4dd341ce43ada90461c Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 21 May 2025 08:55:11 +0800 Subject: [PATCH 10/14] Disk: add `hiddenFolders` (2) --- src/modules/disk/disk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index 4925a9576b..617ef0c8c2 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -394,6 +394,9 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso if (!ffStrbufEqual(&options->folders, &defaultOptions.folders)) yyjson_mut_obj_add_strbuf(doc, module, "folders", &options->folders); + if (!ffStrbufEqual(&options->hiddenFolders, &defaultOptions.hiddenFolders)) + yyjson_mut_obj_add_strbuf(doc, module, "hiddenFolders", &options->hiddenFolders); + if (defaultOptions.calcType != options->calcType) yyjson_mut_obj_add_bool(doc, module, "useAvailable", options->calcType == FF_DISK_CALC_TYPE_AVAILABLE); From d439ce8eb596638bb046df31ea2e3ca6bbb21920 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 21 May 2025 15:09:19 +0800 Subject: [PATCH 11/14] Disk: rename `hiddenFolder` to `hideFolder`; add docs --- doc/json_schema.json | 4 ++++ src/data/help.json | 8 ++++++++ src/detection/disk/disk.c | 4 ++-- src/modules/disk/disk.c | 16 ++++++++-------- src/modules/disk/option.h | 2 +- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index 6b63916a62..597c2fe318 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -1754,6 +1754,10 @@ "type": "string", "description": "A colon (semicolon on Windows) separated list of folder paths for the disk output\nDefault: auto detection using mount-points\nThis option overrides other `show*` options" }, + "hideFolders": { + "type": "string", + "description": "A colon (semicolon on Windows) separated list of folder paths to hide from the disk output\nDefault: /efi:/boot:/boot/efi" + }, "showExternal": { "type": "boolean", "description": "Set if external volume should be printed", diff --git a/src/data/help.json b/src/data/help.json index a66e43d40b..7794deeaa6 100644 --- a/src/data/help.json +++ b/src/data/help.json @@ -840,6 +840,14 @@ "default": "Auto detection using mount-points" } }, + { + "long": "disk-hide-folders", + "desc": "A colon (semicolon on Windows) separated list of folder paths to hide from the disk output", + "arg": { + "type": "path", + "default": "Auto detection using mount-points" + } + }, { "long": "disk-show-regular", "desc": "Specify whether regular volumes should be displayed", diff --git a/src/detection/disk/disk.c b/src/detection/disk/disk.c index 39c0920e57..d52ea948db 100644 --- a/src/detection/disk/disk.c +++ b/src/detection/disk/disk.c @@ -54,11 +54,11 @@ const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks) } } - if (options->hiddenFolders.length) + if (options->hideFolders.length) { FF_LIST_FOR_EACH(FFDisk, disk, *disks) { - if (ffDiskMatchMountpoint(&options->hiddenFolders, disk->mountpoint.chars)) + if (ffDiskMatchMountpoint(&options->hideFolders, disk->mountpoint.chars)) disk->type |= FF_DISK_VOLUME_TYPE_HIDDEN_BIT; } } diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index 617ef0c8c2..4807217395 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -205,9 +205,9 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch return true; } - if (ffStrEqualsIgnCase(subKey, "hidden-folders")) + if (ffStrEqualsIgnCase(subKey, "hide-folders")) { - ffOptionParseString(key, value, &options->hiddenFolders); + ffOptionParseString(key, value, &options->hideFolders); return true; } @@ -299,9 +299,9 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module) continue; } - if (ffStrEqualsIgnCase(key, "hiddenFolders")) + if (ffStrEqualsIgnCase(key, "hideFolders")) { - ffStrbufSetS(&options->hiddenFolders, yyjson_get_str(val)); + ffStrbufSetS(&options->hideFolders, yyjson_get_str(val)); continue; } @@ -394,8 +394,8 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso if (!ffStrbufEqual(&options->folders, &defaultOptions.folders)) yyjson_mut_obj_add_strbuf(doc, module, "folders", &options->folders); - if (!ffStrbufEqual(&options->hiddenFolders, &defaultOptions.hiddenFolders)) - yyjson_mut_obj_add_strbuf(doc, module, "hiddenFolders", &options->hiddenFolders); + if (!ffStrbufEqual(&options->hideFolders, &defaultOptions.hideFolders)) + yyjson_mut_obj_add_strbuf(doc, module, "hideFolders", &options->hideFolders); if (defaultOptions.calcType != options->calcType) yyjson_mut_obj_add_bool(doc, module, "useAvailable", options->calcType == FF_DISK_CALC_TYPE_AVAILABLE); @@ -512,9 +512,9 @@ void ffInitDiskOptions(FFDiskOptions* options) ffStrbufInit(&options->folders); #if _WIN32 || __APPLE__ || __ANDROID__ - ffStrbufInit(&options->hiddenFolders); + ffStrbufInit(&options->hideFolders); #else - ffStrbufInitStatic(&options->hiddenFolders, "/efi:/boot:/boot/efi"); + ffStrbufInitStatic(&options->hideFolders, "/efi:/boot:/boot/efi"); #endif options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT; options->calcType = FF_DISK_CALC_TYPE_FREE; diff --git a/src/modules/disk/option.h b/src/modules/disk/option.h index 54573f2c33..855f6981ce 100644 --- a/src/modules/disk/option.h +++ b/src/modules/disk/option.h @@ -29,7 +29,7 @@ typedef struct FFDiskOptions FFModuleArgs moduleArgs; FFstrbuf folders; - FFstrbuf hiddenFolders; + FFstrbuf hideFolders; FFDiskVolumeType showTypes; FFDiskCalcType calcType; FFPercentageModuleConfig percent; From a0f579072f279ff8f483ee19fce5f82d93474750 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 21 May 2025 16:40:42 +0800 Subject: [PATCH 12/14] Disk: add `--disk-hide-fs` Fix #1762 --- doc/json_schema.json | 4 ++++ src/data/help.json | 10 +++++++++- src/detection/disk/disk.c | 9 --------- src/modules/disk/disk.c | 25 +++++++++++++++++++++++++ src/modules/disk/option.h | 1 + src/util/FFstrbuf.c | 29 +++++++++++++++++++++++++++++ src/util/FFstrbuf.h | 11 +++++++++++ tests/strbuf.c | 14 ++++++++++++++ 8 files changed, 93 insertions(+), 10 deletions(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index 597c2fe318..10634242c8 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -1758,6 +1758,10 @@ "type": "string", "description": "A colon (semicolon on Windows) separated list of folder paths to hide from the disk output\nDefault: /efi:/boot:/boot/efi" }, + "hideFS": { + "type": "string", + "description": "A colon separated file systems to hide from the disk output" + }, "showExternal": { "type": "boolean", "description": "Set if external volume should be printed", diff --git a/src/data/help.json b/src/data/help.json index 7794deeaa6..68f67d17f6 100644 --- a/src/data/help.json +++ b/src/data/help.json @@ -845,7 +845,15 @@ "desc": "A colon (semicolon on Windows) separated list of folder paths to hide from the disk output", "arg": { "type": "path", - "default": "Auto detection using mount-points" + "default": "/efi:/boot:/boot/efi" + } + }, + { + "long": "disk-hide-fs", + "desc": "A colon separated list of file systems to hide from the disk output", + "arg": { + "type": "string", + "default": "" } }, { diff --git a/src/detection/disk/disk.c b/src/detection/disk/disk.c index d52ea948db..0b43027fa0 100644 --- a/src/detection/disk/disk.c +++ b/src/detection/disk/disk.c @@ -54,14 +54,5 @@ const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks) } } - if (options->hideFolders.length) - { - FF_LIST_FOR_EACH(FFDisk, disk, *disks) - { - if (ffDiskMatchMountpoint(&options->hideFolders, disk->mountpoint.chars)) - disk->type |= FF_DISK_VOLUME_TYPE_HIDDEN_BIT; - } - } - return NULL; } diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index 4807217395..edd84dc359 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -179,6 +179,12 @@ void ffPrintDisk(FFDiskOptions* options) if(__builtin_expect(options->folders.length == 0, 1) && (disk->type & ~options->showTypes)) continue; + if (options->hideFolders.length && ffDiskMatchMountpoint(&options->hideFolders, disk->mountpoint.chars)) + continue; + + if (options->hideFS.length && ffStrbufMatchSeparated(&disk->filesystem, &options->hideFS, ':')) + continue; + printDisk(options, disk, ++index); } } @@ -211,6 +217,12 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch return true; } + if (ffStrEqualsIgnCase(subKey, "hide-fs")) + { + ffOptionParseString(key, value, &options->hideFS); + return true; + } + if (ffStrEqualsIgnCase(subKey, "show-regular")) { if (ffOptionParseBoolean(value)) @@ -305,6 +317,12 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module) continue; } + if (ffStrEqualsIgnCase(key, "hideFS")) + { + ffStrbufSetS(&options->hideFS, yyjson_get_str(val)); + continue; + } + if (ffStrEqualsIgnCase(key, "showExternal")) { if (yyjson_get_bool(val)) @@ -397,6 +415,9 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso if (!ffStrbufEqual(&options->hideFolders, &defaultOptions.hideFolders)) yyjson_mut_obj_add_strbuf(doc, module, "hideFolders", &options->hideFolders); + if (!ffStrbufEqual(&options->hideFS, &defaultOptions.hideFS)) + yyjson_mut_obj_add_strbuf(doc, module, "hideFS", &options->hideFS); + if (defaultOptions.calcType != options->calcType) yyjson_mut_obj_add_bool(doc, module, "useAvailable", options->calcType == FF_DISK_CALC_TYPE_AVAILABLE); @@ -516,6 +537,7 @@ void ffInitDiskOptions(FFDiskOptions* options) #else ffStrbufInitStatic(&options->hideFolders, "/efi:/boot:/boot/efi"); #endif + ffStrbufInit(&options->hideFS); options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT; options->calcType = FF_DISK_CALC_TYPE_FREE; options->percent = (FFPercentageModuleConfig) { 50, 80, 0 }; @@ -524,4 +546,7 @@ void ffInitDiskOptions(FFDiskOptions* options) void ffDestroyDiskOptions(FFDiskOptions* options) { ffOptionDestroyModuleArg(&options->moduleArgs); + ffStrbufDestroy(&options->folders); + ffStrbufDestroy(&options->hideFolders); + ffStrbufDestroy(&options->hideFS); } diff --git a/src/modules/disk/option.h b/src/modules/disk/option.h index 855f6981ce..427e159f9f 100644 --- a/src/modules/disk/option.h +++ b/src/modules/disk/option.h @@ -30,6 +30,7 @@ typedef struct FFDiskOptions FFstrbuf folders; FFstrbuf hideFolders; + FFstrbuf hideFS; FFDiskVolumeType showTypes; FFDiskCalcType calcType; FFPercentageModuleConfig percent; diff --git a/src/util/FFstrbuf.c b/src/util/FFstrbuf.c index 32692907aa..3fcebbd2ee 100644 --- a/src/util/FFstrbuf.c +++ b/src/util/FFstrbuf.c @@ -607,3 +607,32 @@ bool ffStrbufRemoveDupWhitespaces(FFstrbuf* strbuf) return changed; } + +/// @brief Check if a separated string contains a substring. +/// @param strbuf The substring to check. +/// @param compLength The length of the separated string to check. +/// @param comp The separated string to check. +/// @param separator The separator character. +bool ffStrbufMatchSeparatedNS(const FFstrbuf* strbuf, uint32_t compLength, const char* comp, char separator) +{ + if (strbuf->length == 0) + return true; + + if (compLength == 0) + return false; + + for (const char* p = comp; p < comp + compLength;) + { + const char* colon = memchr(p, separator, compLength); + if (colon == NULL) + return strcmp(strbuf->chars, p) == 0; + + uint32_t substrLength = (uint32_t) (colon - p); + if (strbuf->length == substrLength && memcmp(strbuf->chars, p, substrLength) == 0) + return true; + + p = colon + 1; + } + + return false; +} diff --git a/src/util/FFstrbuf.h b/src/util/FFstrbuf.h index cd99c863fd..841a4634d3 100644 --- a/src/util/FFstrbuf.h +++ b/src/util/FFstrbuf.h @@ -92,6 +92,7 @@ void ffStrbufLowerCase(FFstrbuf* strbuf); bool ffStrbufGetline(char** lineptr, size_t* n, FFstrbuf* buffer); void ffStrbufGetlineRestore(char** lineptr, size_t* n, FFstrbuf* buffer); bool ffStrbufRemoveDupWhitespaces(FFstrbuf* strbuf); +bool ffStrbufMatchSeparatedNS(const FFstrbuf* strbuf, uint32_t compLength, const char* comp, char separator); FF_C_NODISCARD static inline FFstrbuf ffStrbufCreateA(uint32_t allocate) { @@ -506,4 +507,14 @@ static inline void ffStrbufTrim(FFstrbuf* strbuf, char c) ffStrbufTrimLeft(strbuf, c); } +static inline bool ffStrbufMatchSeparatedS(const FFstrbuf* strbuf, const char* comp, char separator) +{ + return ffStrbufMatchSeparatedNS(strbuf, (uint32_t) strlen(comp), comp, separator); +} + +static inline bool ffStrbufMatchSeparated(const FFstrbuf* strbuf, const FFstrbuf* comp, char separator) +{ + return ffStrbufMatchSeparatedNS(strbuf, comp->length, comp->chars, separator); +} + #define FF_STRBUF_AUTO_DESTROY FFstrbuf __attribute__((__cleanup__(ffStrbufDestroy))) diff --git a/tests/strbuf.c b/tests/strbuf.c index d3f9116ca9..0b786e18de 100644 --- a/tests/strbuf.c +++ b/tests/strbuf.c @@ -635,6 +635,20 @@ int main(void) VERIFY(ffStrbufEqualS(&newStr, "")); } + { + ffStrbufSetStatic(&strbuf, "abc"); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "abc:def:ghi", ' ') == false); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "abc:def:ghi", ':') == true); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "def:ghi", ' ') == false); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "def:ghi", ':') == false); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "def", ':') == false); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "abc", ':') == true); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "", ' ') == false); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, ":abc:", ':') == true); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, "abc:", ':') == true); + VERIFY(ffStrbufMatchSeparatedS(&strbuf, ":abc", ':') == true); + } + //Success puts("\e[32mAll tests passed!" FASTFETCH_TEXT_MODIFIER_RESET); } From c7b061eebdaec795a9bf3b3efaa5926a734ef6fd Mon Sep 17 00:00:00 2001 From: Carter Li Date: Thu, 22 May 2025 09:41:35 +0800 Subject: [PATCH 13/14] DisplayServer (Linux): fix errors on KDE beta Fix #1765 --- .../kde-output-device-v2-client-protocol.h | 142 +++++++++++++++++- .../wayland/kde-output-device-v2-protocol.c | 10 +- .../displayserver/linux/wayland/kde-output.c | 13 ++ .../displayserver/linux/wayland/wayland.h | 3 +- 4 files changed, 164 insertions(+), 4 deletions(-) diff --git a/src/detection/displayserver/linux/wayland/kde-output-device-v2-client-protocol.h b/src/detection/displayserver/linux/wayland/kde-output-device-v2-client-protocol.h index b220a2e98d..a7e98be7a1 100644 --- a/src/detection/displayserver/linux/wayland/kde-output-device-v2-client-protocol.h +++ b/src/detection/displayserver/linux/wayland/kde-output-device-v2-client-protocol.h @@ -5,7 +5,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { @@ -214,6 +214,26 @@ enum kde_output_device_v2_capability { * @since 9 */ KDE_OUTPUT_DEVICE_V2_CAPABILITY_BRIGHTNESS = 0x80, + /** + * if this outputdevice supports the built-in color profile + * @since 12 + */ + KDE_OUTPUT_DEVICE_V2_CAPABILITY_BUILT_IN_COLOR = 0x100, + /** + * if this outputdevice supports DDC/CI + * @since 14 + */ + KDE_OUTPUT_DEVICE_V2_CAPABILITY_DDC_CI = 0x200, + /** + * if this outputdevice supports setting max bpc + * @since 15 + */ + KDE_OUTPUT_DEVICE_V2_CAPABILITY_MAX_BITS_PER_COLOR = 0x400, + /** + * if this outputdevice supports EDR + * @since 16 + */ + KDE_OUTPUT_DEVICE_V2_CAPABILITY_EDR = 0x800, }; /** * @ingroup iface_kde_output_device_v2 @@ -235,6 +255,22 @@ enum kde_output_device_v2_capability { * @ingroup iface_kde_output_device_v2 */ #define KDE_OUTPUT_DEVICE_V2_CAPABILITY_BRIGHTNESS_SINCE_VERSION 9 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_BUILT_IN_COLOR_SINCE_VERSION 12 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_DDC_CI_SINCE_VERSION 14 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_MAX_BITS_PER_COLOR_SINCE_VERSION 15 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_EDR_SINCE_VERSION 16 #endif /* KDE_OUTPUT_DEVICE_V2_CAPABILITY_ENUM */ #ifndef KDE_OUTPUT_DEVICE_V2_VRR_POLICY_ENUM @@ -316,6 +352,18 @@ enum kde_output_device_v2_color_power_tradeoff { }; #endif /* KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_ENUM */ +#ifndef KDE_OUTPUT_DEVICE_V2_EDR_POLICY_ENUM +#define KDE_OUTPUT_DEVICE_V2_EDR_POLICY_ENUM +/** + * @ingroup iface_kde_output_device_v2 + * when the compositor may make use of EDR + */ +enum kde_output_device_v2_edr_policy { + KDE_OUTPUT_DEVICE_V2_EDR_POLICY_NEVER = 0, + KDE_OUTPUT_DEVICE_V2_EDR_POLICY_ALWAYS = 1, +}; +#endif /* KDE_OUTPUT_DEVICE_V2_EDR_POLICY_ENUM */ + /** * @ingroup iface_kde_output_device_v2 * @struct kde_output_device_v2_listener @@ -658,6 +706,74 @@ struct kde_output_device_v2_listener { void (*dimming)(void *data, struct kde_output_device_v2 *kde_output_device_v2, uint32_t multiplier); + /** + * source output for mirroring + * + * + * @param source uuid of the source output + * @since 13 + */ + void (*replication_source)(void *data, + struct kde_output_device_v2 *kde_output_device_v2, + const char *source); + /** + * if DDC/CI should be used to control brightness etc. + * + * If the ddc_ci capability is present, this determines if + * settings such as brightness, contrast or others should be set + * using DDC/CI. + * @param allowed 1 if allowed, 0 if disabled + * @since 14 + */ + void (*ddc_ci_allowed)(void *data, + struct kde_output_device_v2 *kde_output_device_v2, + uint32_t allowed); + /** + * override max bpc + * + * This limits the amount of bits per color that are sent to the + * display. + * @param max_bpc 0 for the default / automatic + * @since 15 + */ + void (*max_bits_per_color)(void *data, + struct kde_output_device_v2 *kde_output_device_v2, + uint32_t max_bpc); + /** + * range of max bits per color value + * + * + * @param min_value the minimum supported by the driver + * @param max_value the maximum supported by the driver + * @since 15 + */ + void (*max_bits_per_color_range)(void *data, + struct kde_output_device_v2 *kde_output_device_v2, + uint32_t min_value, + uint32_t max_value); + /** + * if and to what value automatic max bpc is limited + * + * + * @param max_bpc_limit which value automatic bpc gets limited to. 0 if not limited + * @since 15 + */ + void (*automatic_max_bits_per_color_limit)(void *data, + struct kde_output_device_v2 *kde_output_device_v2, + uint32_t max_bpc_limit); + /** + * when the compositor may apply EDR + * + * When EDR is enabled, the compositor may increase the backlight + * beyond the user-specified setting, in order to present HDR + * content on displays without native HDR support. This will + * usually result in better visuals, but also increases battery + * usage. + * @since 16 + */ + void (*edr_policy)(void *data, + struct kde_output_device_v2 *kde_output_device_v2, + uint32_t policy); }; /** @@ -779,6 +895,30 @@ kde_output_device_v2_add_listener(struct kde_output_device_v2 *kde_output_device * @ingroup iface_kde_output_device_v2 */ #define KDE_OUTPUT_DEVICE_V2_DIMMING_SINCE_VERSION 11 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_REPLICATION_SOURCE_SINCE_VERSION 13 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_DDC_CI_ALLOWED_SINCE_VERSION 14 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_MAX_BITS_PER_COLOR_SINCE_VERSION 15 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_MAX_BITS_PER_COLOR_RANGE_SINCE_VERSION 15 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_AUTOMATIC_MAX_BITS_PER_COLOR_LIMIT_SINCE_VERSION 15 +/** + * @ingroup iface_kde_output_device_v2 + */ +#define KDE_OUTPUT_DEVICE_V2_EDR_POLICY_SINCE_VERSION 16 /** @ingroup iface_kde_output_device_v2 */ diff --git a/src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c b/src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c index aaf23a4738..2d7e153581 100644 --- a/src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c +++ b/src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c @@ -60,12 +60,18 @@ static const struct wl_message kde_output_device_v2_events[] = { { "brightness", "8u", kde_output_device_v2_types + 0 }, { "color_power_tradeoff", "10u", kde_output_device_v2_types + 0 }, { "dimming", "11u", kde_output_device_v2_types + 0 }, + { "replication_source", "13s", kde_output_device_v2_types + 0 }, + { "ddc_ci_allowed", "14u", kde_output_device_v2_types + 0 }, + { "max_bits_per_color", "15u", kde_output_device_v2_types + 0 }, + { "max_bits_per_color_range", "15uu", kde_output_device_v2_types + 0 }, + { "automatic_max_bits_per_color_limit", "15u", kde_output_device_v2_types + 0 }, + { "edr_policy", "16u", kde_output_device_v2_types + 0 }, }; WL_EXPORT const struct wl_interface kde_output_device_v2_interface = { - "kde_output_device_v2", 11, + "kde_output_device_v2", 16, 0, NULL, - 27, kde_output_device_v2_events, + 33, kde_output_device_v2_events, }; static const struct wl_message kde_output_device_mode_v2_events[] = { diff --git a/src/detection/displayserver/linux/wayland/kde-output.c b/src/detection/displayserver/linux/wayland/kde-output.c index 70dcb91087..3a50913876 100644 --- a/src/detection/displayserver/linux/wayland/kde-output.c +++ b/src/detection/displayserver/linux/wayland/kde-output.c @@ -137,6 +137,12 @@ static void waylandKdeHdrListener(void *data, FF_MAYBE_UNUSED struct kde_output_ display->hdrEnabled = !!hdr_enabled; } +static void waylandKdeMaxBitsPerColorListener(void *data, FF_MAYBE_UNUSED struct kde_output_device_v2 *kde_output_device_v2, uint32_t max_bpc) +{ + WaylandDisplay* display = data; + display->bitDepth = (uint8_t) max_bpc; +} + static struct kde_output_device_v2_listener outputListener = { .geometry = waylandKdeGeometryListener, .current_mode = waylandKdeCurrentModeListener, @@ -165,6 +171,12 @@ static struct kde_output_device_v2_listener outputListener = { .brightness = (void*) stubListener, .color_power_tradeoff = (void*) stubListener, .dimming = (void*) stubListener, + .replication_source = (void*) stubListener, + .ddc_ci_allowed = (void*) stubListener, + .max_bits_per_color = (void*) waylandKdeMaxBitsPerColorListener, + .max_bits_per_color_range = (void*) stubListener, + .automatic_max_bits_per_color_limit = (void*) stubListener, + .edr_policy = (void*) stubListener, }; const char* ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) @@ -237,6 +249,7 @@ const char* ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* re item->manufactureYear = display.myear; item->manufactureWeek = display.mweek; item->serial = display.serial; + item->bitDepth = display.bitDepth; } ffStrbufDestroy(&display.description); diff --git a/src/detection/displayserver/linux/wayland/wayland.h b/src/detection/displayserver/linux/wayland/wayland.h index a509e43869..bf29d70c01 100644 --- a/src/detection/displayserver/linux/wayland/wayland.h +++ b/src/detection/displayserver/linux/wayland/wayland.h @@ -34,6 +34,7 @@ typedef struct WaylandData typedef struct WaylandDisplay { WaylandData* parent; + void* internal; int32_t width; int32_t height; int32_t refreshRate; @@ -55,7 +56,7 @@ typedef struct WaylandDisplay uint16_t myear; uint16_t mweek; uint32_t serial; - void* internal; + uint8_t bitDepth; } WaylandDisplay; inline static void stubListener(void* data, ...) From f43e1fd6145b78c19e9c3cebb221db23c1203418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 23 May 2025 15:41:22 +0800 Subject: [PATCH 14/14] Release: v2.44.0 --- CHANGELOG.md | 15 +++++++++++++++ CMakeLists.txt | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b96cae9a8..19697e00da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# 2.44.0 + +Features: +* Add option `--disk-hide-folders` and `--disk-hide-fs` to hide specific mountpoints and filesystems in Disk module (Disk) + * `--disk-hide-folders` defaults to `/efi:/boot:/boot/efi` on Linux and *BSD. Previously these EFI-related folders were hardcoded to be hidden on Linux. + +Bugfixes: +* Fix Apple Terminal compatibility with `--stat` (macOS, #1755) +* Ignore `/usr/bin/script` when detecting shell and terminal (Terminal / Shell, #1761) +* Fix compatibility with KDE Plasma 6.4 which is in beta currently (Display, Linux, #1765) + +Logos: +* Add Kylin (#1760) +* Add UBLinux (#1764) + # 2.43.0 Features: diff --git a/CMakeLists.txt b/CMakeLists.txt index ad48f4292a..b2103fbb72 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 2.43.0 + VERSION 2.44.0 LANGUAGES C DESCRIPTION "Fast neofetch-like system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"