Compare commits

...

39 Commits

Author SHA1 Message Date
Carter Li 855fd6edee Merge pull request #890 from fastfetch-cli/dev
Release v2.11.4
2024-05-06 20:06:58 +08:00
李通洲 d4bd4401a8 Release: v2.11.4 2024-05-06 19:45:45 +08:00
李通洲 689feb39a4 OS (Linux): don't detect debian version on debian derived distros 2024-05-06 18:42:19 +08:00
Carter Li 0f64e2830a OS (Linux): detect pve & armbian 2024-05-06 16:46:27 +08:00
Carter Li 3e24cdc752 CMake: add option CUSTOM_OS_RELEASE_PATH
And remove `--os-file`
2024-05-06 16:25:08 +08:00
李通洲 dc9c285a0b Doc: update README
Who cares how people install a package...

Close #883
2024-05-06 15:56:46 +08:00
李通洲 1d03c9c85e Logo (Builtin): add armbian
Fix #842
2024-05-06 15:22:43 +08:00
李通洲 4eae11df64 Presets: fix neofetch 2024-05-06 15:09:12 +08:00
李通洲 eba13d5485 JsonConfig: fix setting size.ndigits doesn't work
Silly copy & paste error
2024-05-06 15:08:58 +08:00
apocelipes 16b875ef5a Fastfetch: fix memory leaks when passing informative options
Informative options (e.g. "--help", "--list-module") make fastfetch
exit before calling ffDestroyInstance. Using "atexit" to avoid this
kind of leak.
2024-05-06 14:40:27 +08:00
李通洲 366138e1bd CI: try fixing Linux armv7 2024-05-06 14:08:29 +08:00
李通洲 7fe18a5b7c CI: build armv7 package using ubuntu22.04
Hopefully make it usable on RaspberryPi

Fix #884
2024-05-06 09:33:58 +08:00
李通洲 39cd8cfb4c Camera: fix deprecation warning for macOS 14.0 hopefully
Fix #860
2024-05-06 09:25:06 +08:00
李通洲 8b441c85e5 Logo (Builtin): update ubuntu 2024-05-05 23:31:23 +08:00
李通洲 f66e901c44 Presets: remove unsupported format placeholders 2024-05-05 22:12:33 +08:00
李通洲 3815823a20 CMake: enforce glibc version 2024-05-05 21:29:49 +08:00
李通洲 33ff4870dc Fastfetch: enable pipe mode if $NO_COLOR is set 2024-05-05 20:16:43 +08:00
李通洲 479731f076 Custom: don't print ANSI escape code in pipe mode 2024-05-05 20:14:24 +08:00
李通洲 d2f3f47457 Colors: print non-colored blocks in pipe mode 2024-05-05 20:14:24 +08:00
李通洲 5ea89ecba5 Fastfetch: print non-colored logo in pipe mode 2024-05-05 20:14:23 +08:00
Carter Li 865f57bd76 Revert "FFstrbuf: avoid redundant checks (#881)" (#882)
This reverts commit e98e2a3d52.
2024-05-05 18:46:22 +08:00
Nour1248 e98e2a3d52 FFstrbuf: avoid redundant checks (#881) 2024-05-05 18:40:59 +08:00
Carter Li 6bb748869e Terminal (macOS): fix Apple Terminal detection
Fix #878
2024-05-05 13:36:14 +08:00
李通洲 654721b8c5 Doc: remove (kind of) outdated information
Fix #867
2024-05-05 08:39:51 +08:00
Carter Li 0542eac1b9 Doc: metion ANSI 256 colors
Fix #869
2024-05-05 07:33:32 +08:00
apocelipes b9faf8d77f fastfetch: fix #868 (#871)
Fix #868.
2024-05-05 07:10:51 +08:00
Carter Li 61f848146a Merge pull request #862 from fastfetch-cli/dev
Release: v2.11.3
2024-05-04 20:47:54 +08:00
李通洲 4175dfdc3a Doc: update changelog (ci skip) 2024-05-04 20:27:26 +08:00
李通洲 861d9006d7 Release: v2.11.3 2024-05-04 20:11:30 +08:00
李通洲 7ba07bd2e0 Logo (Image): partially revert 71cba24
Images in SSH session and tmux do work for me

Fix #861
2024-05-04 19:43:41 +08:00
李通洲 9fee36a286 Logo (Image): ensure line ending is printed when printing errors 2024-05-04 19:14:45 +08:00
李通洲 2fc9230b29 Disk (Windows): use sub thread to check accessiblity of remote volumes. 2024-05-04 15:15:00 +08:00
李通洲 5fb1286e15 Battery (Windows): simplify code 2024-05-04 12:11:42 +08:00
李通洲 a4cace4765 CMake: add CUSTOM_AMDGPU_IDS_PATH 2024-05-04 10:06:49 +08:00
李通洲 c6d2467a83 Merge remote-tracking branch 'upstream/master' into dev 2024-05-04 10:06:40 +08:00
AxeldeWater db0d38202e Update README.md again for same reason different location (#857)
Oversaw a place where it wasn't updated either
2024-05-04 07:13:38 +08:00
AxeldeWater 9fbb23b135 Update README.md about installing fastfetch on Debian/Ubuntu (#856)
Apparently the file naming standard was changed over time but this was not updated in the README
2024-05-04 00:00:44 +08:00
李通洲 3a990e495b PhysicalDisk: fix temp output in custom formation
I hate `void *`
2024-05-03 20:48:51 +08:00
李通洲 648530ee8f PhysicalDisk: fix doubled output in custom formation
Fix #852
2024-05-03 20:42:39 +08:00
34 changed files with 332 additions and 172 deletions
+6 -2
View File
@@ -173,11 +173,15 @@ jobs:
id: runcmd
with:
arch: armv7
distro: ubuntu22.04
distro: ubuntu20.04
githubToken: ${{ github.token }}
run: |
uname -a
apt-get update && apt-get install -y cmake make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
apt-get update && apt-get install -y wget
# CMake installed by apt has bug `list sub-command REMOVE_ITEM requires two or more arguments`
wget --no-check-certificate https://apt.kitware.com/ubuntu/pool/main/c/cmake/{cmake_3.29.2-0kitware1ubuntu20.04.1_armhf.deb,cmake-data_3.29.2-0kitware1ubuntu20.04.1_all.deb}
dpkg -i *.deb
apt-get install -y make g++ libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev libdrm-dev directx-headers-dev rpm
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
+42 -3
View File
@@ -1,20 +1,59 @@
# 2.11.4
Changes:
* Fastfetch will print a colorless ascii logo in `--pipe` mode for better `lolcat` compatibility. `fastfetch | lolcat` should work and no `--pipe false` needed.
* Previously the logo would be disabled in `--pipe` mode.
* `--os-file` was removed and CMake option `-DCUSTOM_OS_RELEASE_PATH=/path/to/os-release` was added. This option should not used in most cases.
Bugfixes:
* Fix possible out-of-bound memory access (#868)
* Fix Apple Terminal detection (macOS, Terminal)
* Fix doubled output in custom formation (#852)
* Fix deprecation warning for macOS 14.0 hopefully (#860, macOS, Camera)
* Fix memory leaks when passing informative options
* Fix JSON config `size.ndigits` doesn't work
Features:
* Enable `--pipe` mode if environment variable `$NO_COLOR` is set
* Support Armbian and Proxmox distro detection (OS, Linux)
Logo:
* Add Armbian
# 2.11.3
Hotfix for nix (https://github.com/NixOS/nixpkgs/issues/308849#issuecomment-2093962376)
Features:
* Add cmake option `CUSTOM_AMDGPU_IDS_PATH` for specifying custom path of `amdgpu.ids`
Bugfixes:
* Fix hanging when detecting disconnected network drive (Disk, Windows)
* Ensure line ending is printed when printing image logo errors (Logo)
* Revert image logo limitation change in 2.11.2; allow image logo in SSH session and tmux again (#861, Logo)
* Fix doubled output in custom formation (PhysicalDisk, Windows)
# 2.11.2
Hotfix V2 for old kernel
Hotfix for Debian 11
Changes:
* Error messages when trying to print image logo will only be printed with `--show-errors`
* When generating JSON output, fastfetch will generate an empty array when no result is detected, instead of an error.
Bugfixes:
* Fix segfault in Debian 11 and some old kernels. Regression in 2.11.0 (#845, GPU, Linux)
* Fix segfault in Debian 11 and some old kernels. Regression introduced in 2.11.0 (#845, GPU, Linux)
* Don't try detecting version of raw `sh` shell (#849, Shell, Linux)
* Trim `\r` on Windows
Features:
* Check xdg state home for nix user packages (#837, Packages, Linux)
* Disable image logos in ssh and tmux sessions (#839)
* Support MX Linux distro detection (OS, Linux)
* Support MX Linux distro detection (#847, OS, Linux)
Logo:
* Add KernelOS
+20 -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.11.2
VERSION 2.11.4
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -79,6 +79,8 @@ option(IS_MUSL "Build with musl libc" OFF) # Used by Github Actions
if (LINUX)
set(CUSTOM_PCI_IDS_PATH "" CACHE STRING "Custom path to file pci.ids, defaults to `/usr/share/hwdata/pci.ids`")
set(CUSTOM_AMDGPU_IDS_PATH "" CACHE STRING "Custom path to file amdgpu.ids, defaults to `/usr/share/libdrm/amdgpu.ids`")
set(CUSTOM_OS_RELEASE_PATH "" CACHE STRING "Custom path to file os-release, defaults to `/etc/os-release`")
endif()
####################
@@ -784,6 +786,14 @@ if(NOT "${CUSTOM_PCI_IDS_PATH}" STREQUAL "")
message(STATUS "Custom file path of pci.ids: ${CUSTOM_PCI_IDS_PATH}")
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_PCI_IDS_PATH=${CUSTOM_PCI_IDS_PATH})
endif()
if(NOT "${CUSTOM_AMDGPU_IDS_PATH}" STREQUAL "")
message(STATUS "Custom file path of amdgpu.ids: ${CUSTOM_AMDGPU_IDS_PATH}")
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_AMDGPU_IDS_PATH=${CUSTOM_AMDGPU_IDS_PATH})
endif()
if(NOT "${CUSTOM_OS_RELEASE_PATH}" STREQUAL "")
message(STATUS "Custom file path of os_release: ${CUSTOM_OS_RELEASE_PATH}")
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_OS_RELEASE_PATH=${CUSTOM_OS_RELEASE_PATH})
endif()
function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
if(NOT ENABLE_${VARNAME})
@@ -1148,7 +1158,15 @@ if(LINUX)
set(CPACK_DEBIAN_PACKAGE_SECTION, "utils")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
if(NOT IS_MUSL)
EXECUTE_PROCESS (
COMMAND getconf GNU_LIBC_VERSION
OUTPUT_VARIABLE GLIBC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING (REPLACE "glibc " "" GLIBC_VERSION ${GLIBC_VERSION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= ${GLIBC_VERSION})")
endif()
endif()
find_program(HAVE_RPMBUILD "rpmbuild")
-34
View File
@@ -1,34 +0,0 @@
# Development help
This file is not an official documentation!
Here i just add things that are easy to forget.
## Features i am planning to implement
### Specific
- [ ] Split the project in different libs / executables, all linking static by default:
- `libffdetect`: contains all the detection stuff. To be used by anything that needs system information
- `libffprint`: contains the printing functions, logos, format etc
- `fastfetch` and `flashfetch`: Executables, that initialize the config of libffprint. Fist one at runtime, second one at compile time
- [ ] Make LocalIP module more configurable
- [ ] Automatic migrate old config files to newer versions
- [ ] ZSH completions
- [ ] Fish completions
- [ ] Make CPU usage detection much faster and more accurate
- [ ] Detect CPU usage in a common detection method and expose it both to the cpuUsage module and the cpu format string
- [ ] Per session caching
### General
- More presets
- More logos
- More package managers
- More DE detections
- More WM theme detections
- More terminal font detections
- Performance optimizations
- More module specific options
- Better error handling, especially the messages shown when using --show-errors
- Using package managers libraries for package count detection instead own. E.g. using libalpm instead of counting files in /var/lib/pacman/local
- Better documentation (especially default config file and the various --help options. Colored output?)
- General feature parity with neofetch, to demonstrate supremity of c
+1 -1
View File
@@ -30,7 +30,7 @@ There are [screenshots on different platforms](https://github.com/fastfetch-cli/
Some distros packaged an outdated fastfetch version. Older version is not supported, please always ensure that the latest version is used.
* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
* Debian / Ubuntu: Download `fastfetch-<version>-Linux.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and `dpkg -i fastfetch-<version>-Linux.deb` (for Ubuntu 20.04 or newer and Debian 11 or newer).
* Debian / Ubuntu: Download `fastfetch-linux-<proper architecture>.deb` from [Github release page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and double-click it (for Ubuntu 20.04 or newer and Debian 11 or newer).
* Arch Linux: `sudo pacman -S fastfetch`
* Fedora: `sudo dnf install fastfetch`
* Gentoo: `sudo emerge --ask app-misc/fastfetch`
-4
View File
@@ -294,10 +294,6 @@
"type": "string",
"description": "The name of the player to use for module Media and Player. Linux only"
},
"osFile": {
"type": "string",
"description": "Set the path to the file containing OS information. Linux only"
},
"dsForceDrm": {
"description": "Force display detection to use DRM. Linux only",
"oneOf": [
+1 -2
View File
@@ -9,8 +9,7 @@
"modules": [
{
"type": "theme",
"key": "T",
"format": "{7}"
"key": "T"
},
{
"type": "icons",
+9 -12
View File
@@ -1,16 +1,16 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"size": {
"maxPrefix": "MB",
"ndigits": 0
}
},
"modules": [
"title",
"separator",
{
"type": "os",
"format": "{3} {12}"
},
{
"type": "host",
"format": "{/2}{-}{/}{2}{?3} {3}{?}"
},
"os",
"host",
"kernel",
"uptime",
"packages",
@@ -23,10 +23,7 @@
"de",
"wm",
"wmtheme",
{
"type": "theme",
"format": "{?1}{1}{?3} {3}{?} [Plasma], {?}{7}"
},
"theme",
"icons",
"terminal",
{
+2 -2
View File
@@ -11,7 +11,7 @@
bool ffParseModuleOptions(const char* key, const char* value)
{
if (!ffStrStartsWith(key, "--") || !isalpha(key[2])) return false;
if (!ffStrStartsWith(key, "--") || !ffCharIsEnglishAlphabet(key[2])) return false;
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(key[2]) - 'A']; *modules; ++modules)
{
@@ -102,7 +102,7 @@ static void parseStructureCommand(
}
}
if(isalpha(line[0]))
if(ffCharIsEnglishAlphabet(line[0]))
{
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
{
+1 -1
View File
@@ -94,7 +94,7 @@ static inline void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc
static bool parseModuleJsonObject(const char* type, yyjson_val* jsonVal, yyjson_mut_doc* jsonDoc)
{
if(!isalpha(type[0])) return false;
if(!ffCharIsEnglishAlphabet(type[0])) return false;
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(type[0]) - 'A']; *modules; ++modules)
{
+4 -3
View File
@@ -3,7 +3,8 @@ Usage: fastfetch --color <color>
<color> must be a color encoding as ANSI escape sequences. It is inserted between "ESC[" and "m".
Infos about them can be found here: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters.
Examples:
--color 35: sets the color to magenta. `--color magenta` is also supported
--color 4;92: sets the color to bright Green with underline
--color 5;104: blinking text on a blue background
--color 35: sets the color to magenta. `--color magenta` is also supported
--color 38;5;38: sets the color to 38th color of ANSI 256 colors
--color 4;92: sets the color to bright Green with underline
--color 5;104: blinking text on a blue background
If no color is set, the main color of the logo will be used.
+3 -6
View File
@@ -1,4 +1,6 @@
#include "battery.h"
#include "common/io/io.h"
#include "util/windows/unicode.h"
#include "util/mallocHelper.h"
#include "util/smbiosHelper.h"
@@ -20,11 +22,6 @@ NtPowerInformation(
OUT PVOID OutputBuffer OPTIONAL,
IN ULONG OutputBufferLength);
static inline void wrapCloseHandle(HANDLE* handle)
{
if(*handle)
CloseHandle(*handle);
}
static inline void wrapSetupDiDestroyDeviceInfoList(HDEVINFO* hdev)
{
if(*hdev)
@@ -52,7 +49,7 @@ static const char* detectWithSetupApi(FFBatteryOptions* options, FFlist* results
if(!SetupDiGetDeviceInterfaceDetailW(hdev, &did, pdidd, cbRequired, &cbRequired, NULL))
continue;
HANDLE __attribute__((__cleanup__(wrapCloseHandle))) hBattery =
HANDLE FF_AUTO_CLOSE_FD hBattery =
CreateFileW(pdidd->DevicePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hBattery == INVALID_HANDLE_VALUE)
+18 -1
View File
@@ -3,10 +3,27 @@
#import <AVFoundation/AVCaptureDevice.h>
// warning: 'AVCaptureDeviceTypeExternalUnknown' is deprecated
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
const char* ffDetectCamera(FFlist* result)
{
FF_SUPPRESS_IO(); // #822
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeExternalUnknown]
AVCaptureDeviceType deviceType;
#ifdef MAC_OS_VERSION_14_0
if (@available(macOS 14.0, *))
{
deviceType = AVCaptureDeviceTypeExternal;
}
else
#endif
{
deviceType = AVCaptureDeviceTypeExternalUnknown;
}
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType]
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];
if (!session)
+51 -34
View File
@@ -1,10 +1,24 @@
#include "disk.h"
#include "common/io/io.h"
#include "common/thread.h"
#include "util/windows/unicode.h"
#include <windows.h>
#include <winioctl.h>
static unsigned __stdcall testRemoteVolumeAccessable(void* mountpoint)
{
FF_AUTO_CLOSE_FD HANDLE handle = CreateFileW(
(wchar_t*) mountpoint,
READ_CONTROL,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
NULL);
return 0;
}
const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
{
wchar_t buf[MAX_PATH + 1];
@@ -41,28 +55,48 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
FFDisk* disk = ffListAdd(disks);
if(!GetDiskFreeSpaceExW(
disk->filesUsed = 0;
disk->filesTotal = 0;
disk->bytesTotal = 0;
disk->bytesFree = 0;
disk->bytesUsed = 0; // To be filled in ./disk.c
disk->bytesAvailable = 0;
disk->createTime = 0;
ffStrbufInit(&disk->filesystem);
ffStrbufInit(&disk->name);
ffStrbufInitMove(&disk->mountpoint, &buffer);
ffStrbufInit(&disk->mountFrom);
disk->type = driveType == DRIVE_REMOVABLE || driveType == DRIVE_REMOTE || driveType == DRIVE_CDROM
? FF_DISK_VOLUME_TYPE_EXTERNAL_BIT
: driveType == DRIVE_FIXED
? FF_DISK_VOLUME_TYPE_REGULAR_BIT
: FF_DISK_VOLUME_TYPE_HIDDEN_BIT;
if (mountpoint[2] == L'\\' && mountpoint[3] == L'\0')
{
wchar_t volumeName[MAX_PATH + 1];
mountpoint[2] = L'\0';
if(QueryDosDeviceW(mountpoint, volumeName, sizeof(volumeName) / sizeof(*volumeName)))
ffStrbufSetWS(&disk->mountFrom, volumeName);
mountpoint[2] = L'\\';
}
#ifdef FF_HAVE_THREADS
if (driveType == DRIVE_REMOTE)
{
FFThreadType thread = ffThreadCreate(testRemoteVolumeAccessable, mountpoint);
if (!ffThreadJoin(thread, 500))
continue;
}
#endif
GetDiskFreeSpaceExW(
mountpoint,
(PULARGE_INTEGER)&disk->bytesAvailable,
(PULARGE_INTEGER)&disk->bytesTotal,
(PULARGE_INTEGER)&disk->bytesFree
))
{
disk->bytesTotal = 0;
disk->bytesFree = 0;
disk->bytesAvailable = 0;
}
disk->bytesUsed = 0; // To be filled in ./disk.c
);
if(driveType == DRIVE_REMOVABLE || driveType == DRIVE_REMOTE || driveType == DRIVE_CDROM)
disk->type = FF_DISK_VOLUME_TYPE_EXTERNAL_BIT;
else if(driveType == DRIVE_FIXED)
disk->type = FF_DISK_VOLUME_TYPE_REGULAR_BIT;
else
disk->type = FF_DISK_VOLUME_TYPE_HIDDEN_BIT;
ffStrbufInit(&disk->filesystem);
ffStrbufInit(&disk->name);
wchar_t diskName[MAX_PATH + 1], diskFileSystem[MAX_PATH + 1];
//https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getvolumeinformationa#remarks
@@ -89,23 +123,6 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
WIN32_FILE_ATTRIBUTE_DATA data;
if(GetFileAttributesExW(mountpoint, GetFileExInfoStandard, &data) && data.ftCreationTime.dwHighDateTime > 0)
disk->createTime = (*(uint64_t*) &data.ftCreationTime - 116444736000000000ull) / 10000ull;
else
disk->createTime = 0;
ffStrbufInitMove(&disk->mountpoint, &buffer);
if (mountpoint[2] == L'\\' && mountpoint[3] == L'\0')
{
wchar_t volumeName[MAX_PATH + 1];
mountpoint[2] = L'\0';
if(QueryDosDeviceW(mountpoint, volumeName, sizeof(volumeName) / sizeof(*volumeName)))
ffStrbufInitWS(&disk->mountFrom, volumeName);
else
ffStrbufInit(&disk->mountFrom);
}
//Unsupported
disk->filesUsed = 0;
disk->filesTotal = 0;
}
return NULL;
+10 -3
View File
@@ -123,9 +123,11 @@ static void pciDetectIntelSpecific(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf*
static bool loadPciIds(FFstrbuf* pciids)
{
#ifdef FF_CUSTOM_PCI_IDS_PATH
ffReadFileBuffer(FF_STR(FF_CUSTOM_PCI_IDS_PATH), pciids);
if (pciids->length > 0) return true;
#endif
#else
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/hwdata/pci.ids", pciids);
if (pciids->length > 0) return true;
@@ -136,6 +138,8 @@ static bool loadPciIds(FFstrbuf* pciids)
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/local/share/hwdata/pci.ids", pciids);
if (pciids->length > 0) return true;
#endif
return false;
}
@@ -188,7 +192,11 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
{
char query[32];
snprintf(query, sizeof(query), "%X,\t%X,", (unsigned) deviceId, (unsigned) revision);
#ifdef FF_CUSTOM_AMDGPU_IDS_PATH
ffParsePropFile(FF_STR(FF_CUSTOM_AMDGPU_IDS_PATH), query, &gpu->name);
#else
ffParsePropFileData("libdrm/amdgpu.ids", query, &gpu->name);
#endif
}
}
ffStrbufSubstrBefore(drmDir, drmDirPathLength);
@@ -202,8 +210,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
ffStrbufInit(&pciids);
loadPciIds(&pciids);
}
if (pciids.length)
ffGPUParsePciIds(&pciids, subclassId, (uint16_t) vendorId, (uint16_t) deviceId, gpu);
ffGPUParsePciIds(&pciids, subclassId, (uint16_t) vendorId, (uint16_t) deviceId, gpu);
}
pciDetectDriver(gpu, drmDir, buffer);
+46 -7
View File
@@ -2,11 +2,15 @@
#include "common/properties.h"
#include "common/parsing.h"
#include "common/io/io.h"
#include "common/processing.h"
#include "util/stringUtils.h"
#include <string.h>
#include <stdlib.h>
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
static inline bool allRelevantValuesSet(const FFOSResult* result)
{
return result->id.length > 0
@@ -139,14 +143,46 @@ static void getDebianVersion(FFOSResult* result)
ffStrbufSet(&result->versionID, &debianVersion);
}
static bool detectDebianDerived(FFOSResult* result)
{
if (ffStrbufStartsWithS(&result->prettyName, "Armbian ")) // Armbian 24.2.1 bookworm
{
ffStrbufSetS(&result->name, "Armbian");
ffStrbufSetS(&result->id, "armbian");
ffStrbufSetS(&result->idLike, "debian");
ffStrbufClear(&result->versionID);
uint32_t versionStart = ffStrbufFirstIndexC(&result->prettyName, ' ') + 1;
uint32_t versionEnd = ffStrbufNextIndexC(&result->prettyName, versionStart, ' ');
ffStrbufSetNS(&result->versionID, versionEnd - versionStart, result->prettyName.chars + versionStart);
return true;
}
else if (ffPathExists("/usr/bin/pveversion", FF_PATHTYPE_FILE))
{
ffStrbufSetS(&result->id, "pve");
ffStrbufSetS(&result->idLike, "debian");
ffStrbufSetS(&result->name, "Proxmox VE");
ffStrbufClear(&result->versionID);
if (ffProcessAppendStdOut(&result->versionID, (char* const[]) {
"/usr/bin/pveversion",
NULL,
}) == NULL) // pve-manager/8.2.2/9355359cd7afbae4 (running kernel: 6.8.4-2-pve)
{
ffStrbufSubstrBeforeLastC(&result->versionID, '/');
ffStrbufSubstrAfterFirstC(&result->versionID, '/');
}
ffStrbufSetF(&result->prettyName, "Proxmox VE %s", result->versionID.chars);
return true;
}
return false;
}
static void detectOS(FFOSResult* os)
{
if(instance.config.general.osFile.length > 0)
{
parseLsbRelease(instance.config.general.osFile.chars, os);
parseOsRelease(instance.config.general.osFile.chars, os);
return;
}
#ifdef FF_CUSTOM_OS_RELEASE_PATH
parseOsRelease(FF_STR(FF_CUSTOM_OS_RELEASE_PATH), os);
parseLsbRelease(FF_STR(FF_CUSTOM_OS_RELEASE_PATH), os);
return;
#endif
if(instance.config.general.escapeBedrock && parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock" FASTFETCH_TARGET_DIR_ETC "/bedrock-release", os))
{
@@ -193,5 +229,8 @@ void ffDetectOSImpl(FFOSResult* os)
if(ffStrbufIgnCaseEqualS(&os->id, "ubuntu"))
getUbuntuFlavour(os);
else if(ffStrbufIgnCaseEqualS(&os->id, "debian"))
getDebianVersion(os);
{
if (!detectDebianDerived(os))
getDebianVersion(os);
}
}
@@ -519,6 +519,11 @@ static void setTerminalInfoDetails(FFTerminalResult* result)
else if(ffStrbufEqualS(&result->processName, "iTerm.app") || ffStrbufStartsWithS(&result->processName, "iTermServer-"))
ffStrbufInitStatic(&result->prettyName, "iTerm");
else if(ffStrbufEndsWithS(&result->exePath, "Terminal.app/Contents/MacOS/Terminal"))
{
ffStrbufSetStatic(&result->processName, "Apple_Terminal"); // for terminal font detection
ffStrbufInitStatic(&result->prettyName, "Apple Terminal");
}
else if(ffStrbufEqualS(&result->processName, "Apple_Terminal"))
ffStrbufInitStatic(&result->prettyName, "Apple Terminal");
else if(ffStrbufEqualS(&result->processName, "WarpTerminal"))
+2 -3
View File
@@ -249,7 +249,7 @@ static void printCommandHelp(const char* command)
puts(FASTFETCH_DATATEXT_HELP_COLOR);
else if(ffStrEqualsIgnCase(command, "format"))
puts(FASTFETCH_DATATEXT_HELP_FORMAT);
else if(isalpha(command[0]) && ffStrEndsWithIgnCase(command, "-format")) // <module>-format
else if(ffCharIsEnglishAlphabet(command[0]) && ffStrEndsWithIgnCase(command, "-format")) // <module>-format
printCommandFormatHelp(command);
else if(!printSpecificCommandHelp(command))
fprintf(stderr, "Error: No specific help for command '%s' provided\n", command);
@@ -863,6 +863,7 @@ static void writeConfigFile(FFdata* data, const FFstrbuf* filename)
int main(int argc, char** argv)
{
ffInitInstance();
atexit(ffDestroyInstance);
//Data stores things only needed for the configuration of fastfetch
FFdata data = {
@@ -888,6 +889,4 @@ int main(int argc, char** argv)
ffStrbufDestroy(&customValue->value);
}
ffListDestroy(&data.customValues);
ffDestroyInstance();
}
+22
View File
@@ -0,0 +1,22 @@
..
`:]x**j-,'
.,+t***********z\<"
?******************;
'*n` .'`^,;;,^`'. ,cc.
-<. .[l
// ^^ ^^ \\
!^ $2^^$1 ":
'tt}` $2!~]rj_$1 ")t/.
Itttt?' $2~~]rr]$1 `{tttt,
\tttttt!""I$2_]r($1"""~tttttt1
'_tttttttttttt$2)f$1tttttttttttti.
\*ztttttttttttttttttttttttttf**[
l**c)tttttttttttttttttttttttt(z**,
.z*x.`tttttttttttttttttttttttt.`u*n
>` (tttttttttttttttttttttt] "I
,tttttttttttttttttttttt`
./ttttt$2f$1tttttttt$2f$1ttttt(
'I)$2))(\()($1tt$2))|\()($1{;'
$2.~~~~~~~|)~~~~~~~<$1
'$2[)))))1$1|($2)))))))$1?
$2",,," ",,,^
+14
View File
@@ -0,0 +1,14 @@
█ █ █ █ █ █ █ █ █ █ █
███████████████████████
▄▄██ ██▄▄
▄▄██ ███████████ ██▄▄
▄▄██ ██ ██ ██▄▄
▄▄██ ██ ██ ██▄▄
▄▄██ ██ ██ ██▄▄
▄▄██ █████████████ ██▄▄
▄▄██ ██ ██ ██▄▄
▄▄██ ██ ██ ██▄▄
▄▄██ ██ ██ ██▄▄
▄▄██ ██▄▄
███████████████████████
█ █ █ █ █ █ █ █ █ █ █
-1
View File
@@ -18,4 +18,3 @@
.:ooooooolc:. .ooooooooooo'
.':loooooo; ,oooooooooc
..';::c' .;loooo:'
.
+19 -1
View File
@@ -376,6 +376,24 @@ static const FFlogo A[] = {
.colorKeys = FF_COLOR_FG_CYAN,
.colorTitle = FF_COLOR_FG_CYAN,
},
// Armbian
{
.names = {"Armbian"},
.lines = FASTFETCH_DATATEXT_LOGO_ARMBIAN,
.colors = {
FF_COLOR_FG_WHITE,
FF_COLOR_FG_RED,
},
},
// Armbian2
{
.names = {"Armbian2"},
.type = FF_LOGO_LINE_TYPE_ALTER_BIT,
.lines = FASTFETCH_DATATEXT_LOGO_ARMBIAN2,
.colors = {
FF_COLOR_FG_RED,
},
},
// Artix
{
.names = {"artix", "artixlinux", "artix-linux"},
@@ -3336,7 +3354,7 @@ static const FFlogo P[] = {
},
// Proxmox
{
.names = {"proxmox"},
.names = {"Proxmox", "pve"},
.lines = FASTFETCH_DATATEXT_LOGO_PROXMOX,
.colors = {
FF_COLOR_FG_WHITE,
+10 -11
View File
@@ -781,7 +781,7 @@ static bool printImageIfExistsSlowPath(FFLogoType type, bool printError)
if(!getCharacterPixelDimensions(&requestData))
{
if(printError)
fputs("Logo: getCharacterPixelDimensions() failed", stderr);
fputs("Logo: getCharacterPixelDimensions() failed\n", stderr);
return false;
}
@@ -798,7 +798,7 @@ static bool printImageIfExistsSlowPath(FFLogoType type, bool printError)
//We can safely return here, because if realpath failed, we surely won't be able to read the file
ffStrbufDestroy(&requestData.cacheDir);
if(printError)
fputs("Logo: Querying realpath of the image source failed", stderr);
fputs("Logo: Querying realpath of the image source failed\n", stderr);
return false;
}
ffStrbufRecalculateLength(&requestData.cacheDir);
@@ -842,6 +842,13 @@ static bool printImageIfExistsSlowPath(FFLogoType type, bool printError)
bool ffLogoPrintImageIfExists(FFLogoType type, bool printError)
{
if(instance.config.display.pipe)
{
if(printError)
fputs("Logo: Image logo is not supported in pipe mode\n", stderr);
return false;
}
if(!ffPathExists(instance.config.logo.source.chars, FF_PATHTYPE_FILE))
{
if(printError)
@@ -849,22 +856,14 @@ bool ffLogoPrintImageIfExists(FFLogoType type, bool printError)
return false;
}
if (getenv("SSH_TTY"))
{
if(printError)
fputs("Logo: Image logo is not supported in SSH sessions\n", stderr);
return false;
}
const char* term = getenv("TERM");
if((term && ffStrEquals(term, "screen")) || getenv("ZELLIJ") || getenv("TMUX"))
if((term && ffStrEquals(term, "screen")) || getenv("ZELLIJ"))
{
if(printError)
fputs("Logo: Image logo is not supported in terminal multiplexers\n", stderr);
return false;
}
if(type == FF_LOGO_TYPE_IMAGE_ITERM)
return printImageIterm(printError);
+23 -14
View File
@@ -61,7 +61,7 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
FF_STRBUF_AUTO_DESTROY result = ffStrbufCreateA(2048);
if (instance.config.display.brightColor)
if (!instance.config.display.pipe && instance.config.display.brightColor)
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_BOLT);
ffStrbufAppendNC(&result, options->paddingTop, '\n');
@@ -70,7 +70,7 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
instance.state.logoHeight = options->paddingTop;
//Use logoColor[0] as the default color
if(doColorReplacement)
if(doColorReplacement && !instance.config.display.pipe)
ffStrbufAppendF(&result, "\e[%sm", options->colors[0].chars);
while(*data != '\0')
@@ -143,19 +143,27 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
continue;
}
//Map the number to an array index, so that '1' -> 0, '2' -> 1, etc.
int index = ((int) *data) - 49;
//If the index is valid, print the color. Otherwise continue as normal
if(index < 0 || index >= FASTFETCH_LOGO_MAX_COLORS)
if(!instance.config.display.pipe)
{
ffStrbufAppendC(&result, '$');
++currentlineLength;
//Don't continue here, we want to print the current char as unicode
//Map the number to an array index, so that '1' -> 0, '2' -> 1, etc.
int index = ((int) *data) - 49;
//If the index is valid, print the color. Otherwise continue as normal
if(index < 0 || index >= FASTFETCH_LOGO_MAX_COLORS)
{
ffStrbufAppendC(&result, '$');
++currentlineLength;
//Don't continue here, we want to print the current char as unicode
}
else
{
ffStrbufAppendF(&result, "\e[%sm", options->colors[index].chars);
++data;
continue;
}
}
else
{
ffStrbufAppendF(&result, "\e[%sm", options->colors[index].chars);
++data;
continue;
}
@@ -188,7 +196,8 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
}
}
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET);
if(!instance.config.display.pipe)
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET);
if(!options->separate)
{
@@ -460,10 +469,10 @@ static void logoPrintKnownType(void)
void ffLogoPrint(void)
{
//In pipe mode, we don't have a logo or padding.
//When generate JSON result, we don't have a logo or padding.
//We also don't need to set main color, because it won't be printed anyway.
//So we can return quickly here.
if(instance.config.display.pipe || instance.state.resultDoc)
if(instance.state.resultDoc)
{
instance.state.logoHeight = 0;
instance.state.logoWidth = 0;
+8 -7
View File
@@ -16,9 +16,6 @@ static inline uint8_t max(uint8_t a, uint8_t b)
void ffPrintColors(FFColorsOptions* options)
{
if(instance.config.display.pipe)
return;
bool flag = false;
FF_STRBUF_AUTO_DESTROY result = ffStrbufCreateA(128);
@@ -28,7 +25,8 @@ void ffPrintColors(FFColorsOptions* options)
// 3%d: Set the foreground color
for(uint8_t i = options->block.range[0]; i <= min(options->block.range[1], 7); i++)
{
ffStrbufAppendF(&result, "\e[3%dm", i);
if(!instance.config.display.pipe)
ffStrbufAppendF(&result, "\e[3%dm", i);
for (uint8_t j = 0; j < options->block.width; j++)
ffStrbufAppendS(&result, "");
}
@@ -40,7 +38,8 @@ void ffPrintColors(FFColorsOptions* options)
if(options->paddingLeft > 0)
ffPrintCharTimes(' ', options->paddingLeft);
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET);
if(!instance.config.display.pipe)
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET);
ffStrbufPutTo(&result, stdout);
ffStrbufClear(&result);
}
@@ -49,7 +48,8 @@ void ffPrintColors(FFColorsOptions* options)
// 9%d: Set the foreground to the bright color
for(uint8_t i = max(options->block.range[0], 8); i <= options->block.range[1]; i++)
{
ffStrbufAppendF(&result, "\e[1;9%dm", i - 8);
if(!instance.config.display.pipe)
ffStrbufAppendF(&result, "\e[1;9%dm", i - 8);
for (uint8_t j = 0; j < options->block.width; j++)
ffStrbufAppendS(&result, "");
}
@@ -82,7 +82,8 @@ void ffPrintColors(FFColorsOptions* options)
if(options->paddingLeft > 0)
ffPrintCharTimes(' ', options->paddingLeft);
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET);
if(!instance.config.display.pipe)
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_RESET);
ffStrbufPutTo(&result, stdout);
}
+2 -1
View File
@@ -8,7 +8,8 @@ void ffPrintCustom(FFCustomOptions* options)
{
ffPrintLogoAndKey(FF_CUSTOM_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT);
ffStrbufWriteTo(&options->moduleArgs.outputFormat, stdout);
puts(FASTFETCH_TEXT_MODIFIER_RESET);
if(!instance.config.display.pipe)
puts(FASTFETCH_TEXT_MODIFIER_RESET);
}
bool ffParseCustomCommandOptions(FFCustomOptions* options, const char* key, const char* value)
+2
View File
@@ -406,6 +406,8 @@ void ffGenerateDiskJsonResult(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso
yyjson_mut_arr_add_str(doc, typeArr, "Hidden");
if(item->type & FF_DISK_VOLUME_TYPE_READONLY_BIT)
yyjson_mut_arr_add_str(doc, typeArr, "Read-only");
if(item->type & FF_DISK_VOLUME_TYPE_UNKNOWN_BIT)
yyjson_mut_arr_add_str(doc, typeArr, "Unknown");
const char* pstr = ffTimeToFullStr(item->createTime);
if (*pstr)
+2 -3
View File
@@ -107,7 +107,6 @@ void ffPrintPhysicalDisk(FFPhysicalDiskOptions* options)
ffTempsAppendNum(dev->temperature, &tempStr, options->tempConfig);
if (dev->type & FF_PHYSICALDISK_TYPE_READWRITE)
readOnlyType = "Read-write";
ffParseSize(dev->size, &buffer);
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, FF_PHYSICALDISK_NUM_FORMAT_ARGS, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRBUF, &buffer},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->name},
@@ -118,7 +117,7 @@ void ffPrintPhysicalDisk(FFPhysicalDiskOptions* options)
{FF_FORMAT_ARG_TYPE_STRING, removableType},
{FF_FORMAT_ARG_TYPE_STRING, readOnlyType},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->revision},
{FF_FORMAT_ARG_TYPE_DOUBLE, &tempStr},
{FF_FORMAT_ARG_TYPE_STRBUF, &tempStr},
}));
}
++index;
@@ -252,7 +251,7 @@ void ffGeneratePhysicalDiskJsonResult(FFPhysicalDiskOptions* options, yyjson_mut
void ffPrintPhysicalDiskHelpFormat(void)
{
FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_PHYSICALDISK_MODULE_NAME, "{1}", FF_PHYSICALDISK_NUM_FORMAT_ARGS, ((const char* []) {
FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_PHYSICALDISK_MODULE_NAME, "{1} [{6}, {7}, {8}]", FF_PHYSICALDISK_NUM_FORMAT_ARGS, ((const char* []) {
"Device size (formatted)",
"Device name",
"Device interconnect type",
+2 -2
View File
@@ -92,7 +92,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
}
yyjson_val* ndigits = yyjson_obj_get(val, "ndigits");
if (ndigits) options->percentNdigits = (uint8_t) yyjson_get_uint(ndigits);
if (ndigits) options->sizeNdigits = (uint8_t) yyjson_get_uint(ndigits);
}
else if (ffStrEqualsIgnCase(key, "temp"))
{
@@ -350,7 +350,7 @@ void ffOptionsInitDisplay(FFOptionsDisplay* options)
ffStrbufInitStatic(&options->keyValueSeparator, ": ");
options->showErrors = false;
options->pipe = !isatty(STDOUT_FILENO);
options->pipe = !isatty(STDOUT_FILENO) || !!getenv("NO_COLOR");
#ifdef NDEBUG
options->disableLinewrap = !options->pipe;
+1 -1
View File
@@ -27,7 +27,7 @@ typedef struct FFOptionsDisplay
FFstrbuf keyValueSeparator;
bool stat;
bool pipe; //disables logo and all escape sequences
bool pipe; //disables all escape sequences
bool showErrors;
bool disableLinewrap;
bool hideCursor;
-9
View File
@@ -27,8 +27,6 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va
options->escapeBedrock = yyjson_get_bool(val);
else if (ffStrEqualsIgnCase(key, "playerName"))
ffStrbufSetS(&options->playerName, yyjson_get_str(val));
else if (ffStrEqualsIgnCase(key, "osFile"))
ffStrbufSetS(&options->osFile, yyjson_get_str(val));
else if (ffStrEqualsIgnCase(key, "dsForceDrm"))
{
if (yyjson_is_str(val))
@@ -79,8 +77,6 @@ bool ffOptionsParseGeneralCommandLine(FFOptionsGeneral* options, const char* key
options->escapeBedrock = ffOptionParseBoolean(value);
else if(ffStrEqualsIgnCase(key, "--player-name"))
ffOptionParseString(key, value, &options->playerName);
else if (ffStrEqualsIgnCase(key, "--os-file"))
ffOptionParseString(key, value, &options->osFile);
else if(ffStrEqualsIgnCase(key, "--ds-force-drm"))
{
if (ffOptionParseBoolean(value))
@@ -109,7 +105,6 @@ void ffOptionsInitGeneral(FFOptionsGeneral* options)
#if defined(__linux__) || defined(__FreeBSD__)
options->escapeBedrock = true;
ffStrbufInit(&options->playerName);
ffStrbufInit(&options->osFile);
options->dsForceDrm = FF_DS_FORCE_DRM_TYPE_FALSE;
#elif defined(_WIN32)
options->wmiTimeout = 5000;
@@ -120,7 +115,6 @@ void ffOptionsDestroyGeneral(FF_MAYBE_UNUSED FFOptionsGeneral* options)
{
#if defined(__linux__) || defined(__FreeBSD__)
ffStrbufDestroy(&options->playerName);
ffStrbufDestroy(&options->osFile);
#endif
}
@@ -145,9 +139,6 @@ void ffOptionsGenerateGeneralJsonConfig(FFOptionsGeneral* options, yyjson_mut_do
if (!ffStrbufEqual(&options->playerName, &defaultOptions.playerName))
yyjson_mut_obj_add_strbuf(doc, obj, "playerName", &options->playerName);
if (!ffStrbufEqual(&options->osFile, &defaultOptions.osFile))
yyjson_mut_obj_add_strbuf(doc, obj, "osFile", &options->osFile);
if (options->dsForceDrm != defaultOptions.dsForceDrm)
{
switch (options->dsForceDrm)
-1
View File
@@ -17,7 +17,6 @@ typedef struct FFOptionsGeneral
// Module options that cannot be put in module option structure
#if defined(__linux__) || defined(__FreeBSD__)
FFstrbuf playerName;
FFstrbuf osFile;
bool escapeBedrock;
FFDsForceDrmType dsForceDrm;
#elif defined(_WIN32)
+5
View File
@@ -69,3 +69,8 @@ static inline bool ffStrContainsC(const char* str, char compareTo)
{
return strchr(str, compareTo) != NULL;
}
static inline bool ffCharIsEnglishAlphabet(char c)
{
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}
+1 -1
View File
@@ -5,6 +5,6 @@
#define FASTFETCH_TEXT_MODIFIER_BOLT "\033[1m"
#define FASTFETCH_TEXT_MODIFIER_ERROR "\033[1;31m"
#define FASTFETCH_TEXT_MODIFIER_RESET "\033[0m"
#define FASTFETCH_TEXT_MODIFIER_RESET "\033[m"
#endif