Compare commits

..

15 Commits

Author SHA1 Message Date
Carter Li 7e235b6be0 Merge pull request #1766 from fastfetch-cli/dev
Release: v2.44.0
2025-05-23 16:10:12 +08:00
李通洲 f43e1fd614 Release: v2.44.0 2025-05-23 15:41:22 +08:00
Carter Li c7b061eebd DisplayServer (Linux): fix errors on KDE beta
Fix #1765
2025-05-22 09:41:35 +08:00
Carter Li a0f579072f Disk: add --disk-hide-fs
Fix #1762
2025-05-21 16:40:42 +08:00
Carter Li d439ce8eb5 Disk: rename hiddenFolder to hideFolder; add docs 2025-05-21 15:09:19 +08:00
Carter Li e2a714732a Disk: add hiddenFolders (2) 2025-05-21 15:00:42 +08:00
asmeron a993a6f126 Logo (Builtin): Add UBLinux Logo (#1764)
* Logo (Builtin): Add UBLinux Logo

* Update builtin.c

---------

Co-authored-by: asmeron <asmeron@ublinux.com>
Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2025-05-20 21:50:34 -05:00
李通洲 8eb8f710d0 Disk: add option --disk-hidden-folders 2025-05-19 18:32:56 +08:00
李通洲 526868e355 Disk (Linux): don't hard code hidden mount points 2025-05-19 15:25:06 +08:00
李通洲 768238cb46 TerminalShell (Linux): ignore script
Fix #1761
2025-05-17 18:04:41 +08:00
Xavier Xiong 2d938042d0 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
2025-05-16 01:05:42 -05:00
李通洲 9a54d92e9f Stat: use ESC 7/8 instead of CSI s/u
Fix Apple Terminal compatibility #1755
2025-05-16 10:33:58 +08:00
Collin 839abab744 Doc: Add information of where to find example config files (#1759) [ci skip] 2025-05-15 19:58:36 -05:00
Md. Iftakhar Awal Chowdhury c054570308 fish complete: add --logo-color-[1-9] completion (#1754)
* fish complete: add `--logo-color-[1-9]` completion

* reverted unnecessary changes
2025-05-15 03:18:19 -05:00
Carter Li ed69a7059b Packaging: update debian stuff [ci skip] 2025-05-14 09:51:44 +08:00
31 changed files with 428 additions and 21 deletions
+15
View File
@@ -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:
+1 -1
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.43.0
VERSION 2.44.0
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
+2
View File
@@ -21,6 +21,8 @@ Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for
<img src="screenshots/example3.png" width="48%" align="top" />
<img src="screenshots/example5.png" height="15%" align="top" />
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
+8 -1
View File
@@ -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()
+6
View File
@@ -1,3 +1,9 @@
fastfetch (2.43.0) jammy; urgency=medium
* Update to 2.43.0
-- Carter Li <zhangsongcui@live.cn> Wed, 14 May 2025 09:49:50 +0800
fastfetch (2.42.0) jammy; urgency=medium
* Update to 2.42.0
+1 -1
View File
@@ -1 +1 @@
fastfetch_2.42.0_source.buildinfo universe/utils optional
fastfetch_2.43.0_source.buildinfo universe/utils optional
+8
View File
@@ -1754,6 +1754,14 @@
"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"
},
"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",
+1 -1
View File
@@ -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 <len>; Print <str>; Load
printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
}
}
+1 -1
View File
@@ -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 <len>; Print <str>; Load
printf("\e7\e[1A\e[9999999C\e[%dD%s\e8", len, str); // Save; Up 1; Right 9999999; Left <len>; Print <str>; Load
}
}
+16
View File
@@ -840,6 +840,22 @@
"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": "/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": ""
}
},
{
"long": "disk-show-regular",
"desc": "Specify whether regular volumes should be displayed",
+4 -4
View File
@@ -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;
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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"))
+1 -1
View File
@@ -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;
}
+2 -2
View File
@@ -220,7 +220,7 @@ static bool isRemovable(FFDisk* currentDisk)
static void detectType(const FFlist* disks, FFDisk* currentDisk, struct mntent* device)
{
if(ffStrbufStartsWithS(&currentDisk->mountpoint, "/boot") || ffStrbufStartsWithS(&currentDisk->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;
@@ -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))
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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)
@@ -5,7 +5,7 @@
#include <stdint.h>
#include <stddef.h>
#include <wayland-util.h>
#include <wayland-client.h>
#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 */
@@ -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[] = {
@@ -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);
@@ -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, ...)
@@ -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
+22
View File
@@ -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=
+19
View File
@@ -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###'
+11
View File
@@ -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#
+38
View File
@@ -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
{},
};
@@ -4722,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"},
+45
View File
@@ -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);
}
}
@@ -205,6 +211,18 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch
return true;
}
if (ffStrEqualsIgnCase(subKey, "hide-folders"))
{
ffOptionParseString(key, value, &options->hideFolders);
return true;
}
if (ffStrEqualsIgnCase(subKey, "hide-fs"))
{
ffOptionParseString(key, value, &options->hideFS);
return true;
}
if (ffStrEqualsIgnCase(subKey, "show-regular"))
{
if (ffOptionParseBoolean(value))
@@ -293,6 +311,18 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module)
continue;
}
if (ffStrEqualsIgnCase(key, "hideFolders"))
{
ffStrbufSetS(&options->hideFolders, yyjson_get_str(val));
continue;
}
if (ffStrEqualsIgnCase(key, "hideFS"))
{
ffStrbufSetS(&options->hideFS, yyjson_get_str(val));
continue;
}
if (ffStrEqualsIgnCase(key, "showExternal"))
{
if (yyjson_get_bool(val))
@@ -382,6 +412,12 @@ 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->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);
@@ -496,6 +532,12 @@ void ffInitDiskOptions(FFDiskOptions* options)
ffOptionInitModuleArg(&options->moduleArgs, "");
ffStrbufInit(&options->folders);
#if _WIN32 || __APPLE__ || __ANDROID__
ffStrbufInit(&options->hideFolders);
#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 };
@@ -504,4 +546,7 @@ void ffInitDiskOptions(FFDiskOptions* options)
void ffDestroyDiskOptions(FFDiskOptions* options)
{
ffOptionDestroyModuleArg(&options->moduleArgs);
ffStrbufDestroy(&options->folders);
ffStrbufDestroy(&options->hideFolders);
ffStrbufDestroy(&options->hideFS);
}
+2
View File
@@ -29,6 +29,8 @@ typedef struct FFDiskOptions
FFModuleArgs moduleArgs;
FFstrbuf folders;
FFstrbuf hideFolders;
FFstrbuf hideFS;
FFDiskVolumeType showTypes;
FFDiskCalcType calcType;
FFPercentageModuleConfig percent;
+29
View File
@@ -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;
}
+11
View File
@@ -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)))
+14
View File
@@ -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);
}