Compare commits

..

28 Commits

Author SHA1 Message Date
Carter Li 5df2a751ea Merge pull request #1173 from fastfetch-cli/dev
Release v2.21.1
2024-08-09 10:49:50 +08:00
李通洲 65b9f0005b TerminalFont (Linux): when detecting st, report an error if fails to load libelf 2024-08-09 10:11:38 +08:00
李通洲 a3e4b4fe22 Release v2.21.1 2024-08-09 09:54:49 +08:00
李通洲 0749704400 Version: report git commit hash 2024-08-09 09:54:49 +08:00
李通洲 9977cb688d Presets: set timeout to publicip
Fix #1170
2024-08-09 08:47:48 +08:00
李通洲 8c26e776c2 InitSystem (Android): don't break build 2024-08-09 08:40:41 +08:00
李通洲 e174eddef1 GPU (Linux): always try directx 2024-08-08 18:53:56 +08:00
李通洲 f866c90687 GPU: defaults to --gpu-detection-method pci on x86 to detect disabled gpus 2024-08-08 16:23:58 +08:00
李通洲 a61a956b84 CI (Linux): fix libelf dep installation on musl 2024-08-08 16:09:48 +08:00
李通洲 ef73c4a97d CI: build with libelf 2024-08-08 15:49:51 +08:00
Carter Li 79c02ebf7c CI: fix build on FreeBSD & SunOS 2024-08-08 15:36:17 +08:00
李通洲 1394a0ae2e InitSystem (macOS): fix compiling 2024-08-08 15:23:40 +08:00
Carter Li e8ebae7ee9 TerminalFont (Linux): improve performance of st terminal font detection 2024-08-08 15:09:37 +08:00
Carter Li 3fae29ba8f InitSystem (Linux): add fast path for systemd version detection 2024-08-08 15:09:37 +08:00
Carter Li a9373fb4e4 Util (Linux): add elf helper 2024-08-08 15:09:37 +08:00
Carter Li 2e2cf64452 Terminal (Linux): add kitty version detection fast path back 2024-08-08 14:58:56 +08:00
Carter Li 7c3835bd9f DBus: increase dbus timeout 2024-08-08 09:01:41 +08:00
Princess-Sunset-Shimmer 945fd3a402 Logo (Builtin): add vanilla OS 2 logo (#1168)
* Create vanilla_small.txt

* Update builtin.c

for new vanilla small logo

* Update builtin.c

* Create 23.jsonc

* Update 23.jsonc

* Update builtin.c

* Create vanilla2.txt

new byte bloat is comming

* Update builtin.c

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-08-07 19:34:05 +08:00
AlbydS 53d2dbd420 Logo (Builtin): Add support for Linux From Scratch (#1165)
* Add Linux From Scratch logo

Added ASCII logo for Linux From Scratch

* Add Linux From Scratch to builtin.c

I added Linux From Scratch support to builtin.c

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-08-07 14:46:24 +08:00
李通洲 eaa4721b36 Chore: update editorconfig [ci skip] 2024-08-07 10:59:14 +08:00
TheCourierNV f695ae9116 Locale (Linux): Add LC_ALL check (#1166)
`LC_ALL`, if set, overrides every other locale-related environment
variable.
2024-08-07 10:53:57 +08:00
Princess-Sunset-Shimmer b0270f36f9 Logo (Builtin): add new small vanilla logo (#1167)
* Create vanilla_small.txt

* Update builtin.c

for new vanilla small logo

* Update builtin.c

* Create 23.jsonc

* Update 23.jsonc

* Update builtin.c

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
2024-08-07 10:49:44 +08:00
Carter Li fe5b07e0d0 Colors (Linux): fix light color doesn't work on Linux tty
Ref: https://github.com/fastfetch-cli/fastfetch/issues/1141#issuecomment-2271060911
2024-08-07 10:15:01 +08:00
Carter Li 8396f000e1 DisplayServer (Linux): don't rely on $XDG_SESSION_TYPE for detecting wm protocol
Fix #1162
2024-08-06 16:34:01 +08:00
Carter Li 1361e8cd18 GPU (Linux): fix wrong GPU max frequency on asahi 2024-08-06 10:14:39 +08:00
李通洲 b3ac696312 Wifi (Linux): fix building error without linux/wireless.h
Fix #1160
2024-08-05 22:01:40 +08:00
Linus Dierheimer 2205712bc0 Update FUNDING.yml [ci skip]
So he is shown on the front page
2024-08-05 10:52:40 +02:00
Carter Li f1741c66bf Packaging: update debian stuff [ci skip] 2024-08-05 14:36:44 +08:00
41 changed files with 444 additions and 74 deletions
+2 -2
View File
@@ -7,10 +7,10 @@ tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.{md,fflogo}]
[*.md]
trim_trailing_whitespace = false
[*.{fflogo}]
[*.txt]
insert_final_newline = false
[*.yml]
+1 -1
View File
@@ -1 +1 @@
github: [LinusDierheimer, CarterLi]
github: [CarterLi, LinusDierheimer]
+8 -8
View File
@@ -35,7 +35,7 @@ jobs:
run: uname -a
- name: configure project
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OSMESA=OFF -DENABLE_OPENCL=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . -DENABLE_VULKAN=OFF -DENABLE_WAYLAND=OFF -DENABLE_XCB_RANDR=OFF -DENABLE_XCB=OFF -DENABLE_XRANDR=OFF -DENABLE_X11=OFF -DENABLE_DRM=OFF -DENABLE_GIO=OFF -DENABLE_DCONF=OFF -DENABLE_DBUS=OFF -DENABLE_XFCONF=OFF -DENABLE_SQLITE3=OFF -DENABLE_RPM=OFF -DENABLE_IMAGEMAGICK7=OFF -DENABLE_IMAGEMAGICK6=OFF -DENABLE_CHAFA=OFF -DENABLE_ZLIB=OFF -DENABLE_EGL=OFF -DENABLE_GLX=OFF -DENABLE_OSMESA=OFF -DENABLE_OPENCL=OFF -DENABLE_FREETYPE=OFF -DENABLE_PULSE=OFF -DENABLE_DDCUTIL=OFF -DENABLE_ELF=OFF -DENABLE_DIRECTX_HEADERS=OFF -DENABLE_THREADS=OFF
- name: build project
run: cmake --build . --target package --verbose -j4
@@ -74,7 +74,7 @@ jobs:
run: uname -a
- name: install required packages
run: sudo apt-get update && sudo apt-get install -y 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 libpulse-dev libdrm-dev directx-headers-dev
run: sudo apt-get update && sudo apt-get install -y 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 libpulse-dev libdrm-dev libelf-dev directx-headers-dev
- name: install linuxbrew packages
run: |
@@ -142,7 +142,7 @@ jobs:
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 libpulse-dev libdrm-dev directx-headers-dev rpm
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 libpulse-dev libdrm-dev libelf-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
@@ -181,7 +181,7 @@ jobs:
# 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 libpulse-dev libdrm-dev directx-headers-dev rpm
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 libpulse-dev libdrm-dev libelf-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
@@ -216,7 +216,7 @@ jobs:
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 libpulse-dev libdrm-dev libddcutil-dev libchafa-dev directx-headers-dev rpm
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 libpulse-dev libdrm-dev libddcutil-dev libchafa-dev libelf-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
@@ -247,7 +247,7 @@ jobs:
run: |
cat /etc/alpine-release
uname -a
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev gcc g++
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
shell: alpine.sh --root {0}
- name: build
@@ -288,7 +288,7 @@ jobs:
run: |
cat /etc/alpine-release
uname -a
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev gcc g++
apk add cmake samurai vulkan-loader-dev libxcb-dev wayland-dev libdrm-dev dconf-dev imagemagick-dev chafa-dev zlib-dev dbus-dev mesa-dev opencl-dev xfconf-dev sqlite-dev networkmanager-dev pulseaudio-dev ddcutil-dev elfutils-dev gcc g++
shell: alpine.sh --root {0}
- name: build
@@ -422,7 +422,7 @@ jobs:
run: |
uname -a
sudo pkg update
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
sudo pkg install -y cmake git pkgconf binutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 libdrm libelf glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd v4l_compat
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
cmake --build . --target package --verbose -j4
./fastfetch --list-features
+27
View File
@@ -1,3 +1,30 @@
# 2.21.1
Hotfix for a regression that breaks WM detection when running `startx` from TTY (Regression from 2.21.0, #1172 / #1162)
Changes:
* On Linux, FreeBSD and SunOS, a new recommended dependency `libelf` is introduced to extract strings in ELF binary, used for
* st term font detection when the term font is compiled directly into the binary
* fast path of systemd version detection
Features:
* Improve performance of
* kitty version detection (Terminal, Linux)
* st term font detection (TerminalFont, Linux)
* systemd version detection (InitSystem, Linux)
Bugfixes:
* Fix building error without `linux/wireless.h` (Wifi, Linux)
* Fix wrong GPU max frequency on Asahi Linux (GPU, Linux)
* Don't rely `$XDG_SESSION_TYPE` for detecting wm protocol (#1172 / #1162, WM, Linux)
* Fix light color doesn't work on Linux console (Colors, Linux)
* `LC_ALL`, if set, overrides every other locale-related environment variable (Locale)
* Increase timeout of DBus calls (Linux)
Logos:
* Add vanilla_small and vanilla2
* Add LFS (Linux From Scratch)
# 2.21.0
Changes:
+11 -3
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.21.0
VERSION 2.21.1
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -69,6 +69,7 @@ cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF)
cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF)
cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF)
cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR FreeBSD OR SunOS" OFF)
cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF)
option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
@@ -201,10 +202,10 @@ if (SET_TWEAK AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE PROJECT_VERSION_TWEAK
OUTPUT_VARIABLE PROJECT_VERSION_GIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_TWEAK}")
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_GIT}")
endif()
if(PROJECT_VERSION_TWEAK)
string(REGEX MATCH "[0-9]+" PROJECT_VERSION_TWEAK_NUM "${PROJECT_VERSION_TWEAK}")
@@ -480,6 +481,7 @@ if(LINUX)
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_linux.c
src/util/platform/FFPlatform_unix.c
src/util/linux/elf.c
)
elseif(ANDROID)
list(APPEND LIBFASTFETCH_SRC
@@ -619,6 +621,7 @@ elseif(FreeBSD)
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_linux.c
src/util/platform/FFPlatform_unix.c
src/util/linux/elf.c
)
elseif(APPLE)
list(APPEND LIBFASTFETCH_SRC
@@ -826,6 +829,7 @@ elseif(SunOS)
src/detection/wmtheme/wmtheme_linux.c
src/detection/camera/camera_nosupport.c
src/util/platform/FFPlatform_unix.c
src/util/linux/elf.c
)
endif()
@@ -1075,6 +1079,10 @@ ff_lib_enable(DDCUTIL
"ddcutil"
"Ddcutil"
)
ff_lib_enable(ELF
"libelf"
"libelf"
)
ff_lib_enable(DIRECTX_HEADERS
"DirectX-Headers"
"DirectX-Headers"
+12
View File
@@ -1,3 +1,15 @@
fastfetch (2.21.0) jammy; urgency=medium
* Update to 2.21.0
-- Carter Li <zhangsongcui@live.cn> Mon, 05 Aug 2024 14:35:43 +0800
fastfetch (2.20.0) jammy; urgency=medium
* Update to 2.20.0
-- Carter Li <zhangsongcui@live.cn> Fri, 26 Jul 2024 14:02:50 +0800
fastfetch (2.19.1) jammy; urgency=medium
* Update to 2.19.1
+1 -1
View File
@@ -1 +1 @@
fastfetch_2.19.1_source.buildinfo universe/utils optional
fastfetch_2.20.0_source.buildinfo universe/utils optional
+4
View File
@@ -730,6 +730,10 @@
"ddcutil": {
"description": "Used for brightness detection of external displays (Linux)",
"type": "string"
},
"elf": {
"description": "Used for st terminal font detection and systemd version detection (Linux)",
"type": "string"
}
}
},
+4 -1
View File
@@ -58,7 +58,10 @@
"poweradapter",
"player",
"media",
"publicip",
{
"type": "publicip",
"timeout": 1000
},
{
"type": "localip",
"showIpv6": true,
+2 -1
View File
@@ -75,7 +75,8 @@
},
{
"type": "publicip",
"key": "WAN IP"
"key": "WAN IP",
"timeout": 1000
}
]
}
+4 -1
View File
@@ -60,7 +60,10 @@
"poweradapter",
"player",
"media",
"publicip",
{
"type": "publicip",
"timeout": 1000
},
{
"type": "localip",
"showIpv6": true,
+2 -1
View File
@@ -97,7 +97,8 @@
{
"key": "Public IP ",
"keyColor": "cyan",
"type": "publicip"
"type": "publicip",
"timeout": 1000
},
"break",
{
+4 -1
View File
@@ -66,7 +66,10 @@
"type": "localip",
"compact": true
},
"publicip",
{
"type": "publicip",
"timeout": 1000
},
{
"type": "wifi",
"format": "{ssid}"
+57
View File
@@ -0,0 +1,57 @@
// designed for presenting Vanilla Linux
// inspired from imstilllearnin's Vanilla Logo Ultra
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"color": {
"output": "cyan"
},
"separator": ""
},
"modules": [
{
"type": "kernel",
"key": "Vanilla ",
"keyColor": "blue"
},
{
"type": "packages",
"key": " [_Packages_> ",
"keyColor": "green"
},
{
"type": "localip",
"key": " [_Local_IP_> ",
"keyColor": "green"
},
{
"type": "cpu",
"key": " [_CPU______> ",
"keyColor": "magenta"
},
{
"type": "memory",
"key": " [_RAM______> ",
"keyColor": "magenta"
},
{
"type": "swap",
"key": " [_SWAP_____> ",
"keyColor": "magenta"
},
{
"type": "disk",
"key": " [_Disk_____> ",
"keyColor": "magenta"
},
"break",
{
"type":"colors",
"paddingLeft": 9,
"symbol": "circle"
}
]
}
+2 -1
View File
@@ -161,7 +161,8 @@
{
"type": "publicip",
"key": "├─󰩠",
"keyColor": "blue"
"keyColor": "blue",
"timeout": 1000
},
{
"type": "wifi",
+2 -1
View File
@@ -6,7 +6,8 @@
#include "util/FFstrbuf.h"
#include "common/library.h"
#define FF_DBUS_TIMEOUT_MILLISECONDS 35
#define FF_DBUS_TIMEOUT_MILLISECONDS 100
typedef struct FFDBusLibrary
{
FF_LIBRARY_SYMBOL(dbus_bus_get)
+3
View File
@@ -248,6 +248,9 @@ void ffListFeatures(void)
#if FF_HAVE_DDCUTIL
"libddcutil\n"
#endif
#if FF_HAVE_ELF
"libelf\n"
#endif
#if FF_HAVE_DIRECTX_HEADERS
"Directx Headers\n"
#endif
+7
View File
@@ -935,6 +935,13 @@
"arg": {
"type": "path"
}
},
{
"long": "lib-elf",
"desc": "Used for st terminal font detection and systemd version detection",
"arg": {
"type": "path"
}
}
],
"Module specific": [
@@ -46,9 +46,7 @@ static void getWMProtocolNameFromEnv(FFDisplayServerResult* result)
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
{
getWMProtocolNameFromEnv(ds);
if (!ffStrbufEqualS(&ds->wmProtocolName, FF_WM_PROTOCOL_TTY) &&instance.config.general.dsForceDrm == FF_DS_FORCE_DRM_TYPE_FALSE)
if (instance.config.general.dsForceDrm == FF_DS_FORCE_DRM_TYPE_FALSE)
{
//We try wayland as our preferred display server, as it supports the most features.
//This method can't detect the name of our WM / DE
@@ -96,6 +94,9 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
}
#endif
if (ds->wmProtocolName.length == 0)
getWMProtocolNameFromEnv(ds);
if(!ffStrbufEqualS(&ds->wmProtocolName, FF_WM_PROTOCOL_TTY))
{
//This fills in missing information about WM / DE by using env vars and iterating processes
+23 -15
View File
@@ -14,11 +14,12 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#if __has_include(<drm/asahi_drm.h>)
#include <drm/asahi_drm.h>
#else
// https://github.com/AsahiLinux/linux/blob/asahi/include/uapi/drm/asahi_drm.h
/* SPDX-License-Identifier: MIT */
/* Copyright (C) The Asahi Linux Contributors */
#define DRM_ASAHI_UNSTABLE_UABI_VERSION 10011
#define DRM_ASAHI_GET_PARAMS 0x00
#define DRM_ASAHI_MAX_CLUSTERS 32
struct drm_asahi_params_global
@@ -46,8 +47,9 @@
__u32 pad1;
__u64 vm_user_start;
__u64 vm_user_end;
__u64 vm_shader_start;
__u64 vm_shader_end;
__u64 vm_usc_start;
__u64 vm_usc_end;
__u64 vm_kernel_min_size;
__u32 max_syncs_per_submission;
__u32 max_commands_per_submission;
@@ -61,6 +63,8 @@
__u32 result_render_size;
__u32 result_compute_size;
__u32 firmware_version[4];
};
struct drm_asahi_get_params
@@ -85,7 +89,6 @@
{
DRM_IOCTL_ASAHI_GET_PARAMS = DRM_IOWR(DRM_COMMAND_BASE + DRM_ASAHI_GET_PARAMS, struct drm_asahi_get_params),
};
#endif
#endif
#define FF_STR_INDIR(x) #x
@@ -424,9 +427,14 @@ FF_MAYBE_UNUSED static const char* detectAsahi(FFlist* gpus, FFstrbuf* buffer, F
.size = sizeof(paramsGlobal),
}) >= 0)
{
gpu->coreCount = (int) paramsGlobal.num_cores_total_active;
gpu->frequency = paramsGlobal.max_frequency_khz / 1000;
gpu->deviceId = paramsGlobal.chip_id;
// FIXME: They will introduce ABI breaking changes. Always check the latest version
// https://www.reddit.com/r/AsahiLinux/comments/1ei2qiv/comment/lgm0v5s/
if (paramsGlobal.unstable_uabi_version == DRM_ASAHI_UNSTABLE_UABI_VERSION)
{
gpu->coreCount = (int) paramsGlobal.num_cores_total_active;
gpu->frequency = paramsGlobal.max_frequency_khz / 1000;
gpu->deviceId = paramsGlobal.chip_id;
}
}
}
#endif
@@ -516,14 +524,14 @@ static const char* pciDetectGPUs(const FFGPUOptions* options, FFlist* gpus)
const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
{
#ifdef FF_HAVE_DIRECTX_HEADERS
const char* ffGPUDetectByDirectX(const FFGPUOptions* options, FFlist* gpus);
if (ffGPUDetectByDirectX(options, gpus) == NULL)
return NULL;
#endif
if (options->detectionMethod == FF_GPU_DETECTION_METHOD_AUTO)
{
#ifdef FF_HAVE_DIRECTX_HEADERS
const char* ffGPUDetectByDirectX(const FFGPUOptions* options, FFlist* gpus);
if (ffGPUDetectByDirectX(options, gpus) == NULL)
return NULL;
#endif
if (drmDetectGPUs(options, gpus) == NULL && gpus->length > 0)
return NULL;
}
+1 -1
View File
@@ -28,7 +28,7 @@ private:
extern "C"
const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* gpus)
{
FF_LIBRARY_LOAD(libdxcore, nullptr, "dlopen libdxcore.so failed. Make sure WSLg is enabled", "/usr/lib/wsl/lib/libdxcore" FF_LIBRARY_EXTENSION, 4)
FF_LIBRARY_LOAD(libdxcore, nullptr, "dlopen libdxcore.so failed", "/usr/lib/wsl/lib/libdxcore" FF_LIBRARY_EXTENSION, 4)
// DXCoreCreateAdapterFactory is a reloaded function, so we can't use FF_LIBRARY_LOAD_SYMBOL_MESSAGE here
typedef HRESULT (*DXCoreCreateAdapterFactory_t)(REFIID riid, void** ppvFactory);
+33 -11
View File
@@ -1,7 +1,22 @@
#include "initsystem.h"
#include "common/processing.h"
#include "util/linux/elf.h"
#include <unistd.h>
FF_MAYBE_UNUSED static bool elfExtractStringsCallBack(const char* str, uint32_t len, void* data)
{
if (len > strlen("systemd 0.0 running in ") && memcmp(str, "systemd ", strlen("systemd ")) == 0)
{
const char* pend = memmem(str + strlen("systemd "), len - strlen("systemd "), " running in ", strlen(" running in "));
if (pend)
{
ffStrbufSetNS((FFstrbuf*) data, (uint32_t) (pend - str) - (uint32_t) strlen("systemd "), str + strlen("systemd "));
return false;
}
}
return true;
}
const char* ffDetectInitSystem(FFInitSystemResult* result)
{
const char* error = ffProcessGetBasicInfoLinux((int) result->pid, &result->name, NULL, NULL);
@@ -31,24 +46,30 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
if (instance.config.general.detectVersion)
{
#if __linux__ && !__ANDROID__
if (ffStrbufEqualS(&result->name, "systemd"))
{
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/systemd") ? result->exe.chars : "systemctl", // use exe path in case users have another systemd installed
"--version",
NULL,
}) == NULL && result->version.length)
ffElfExtractStrings(result->exe.chars, elfExtractStringsCallBack, &result->version);
if (result->version.length == 0)
{
uint32_t iStart = ffStrbufFirstIndexC(&result->version, '(');
if (iStart < result->version.length)
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/systemd") ? result->exe.chars : "systemctl", // use exe path in case users have another systemd installed
"--version",
NULL,
}) == NULL && result->version.length)
{
uint32_t iEnd = ffStrbufNextIndexC(&result->version, iStart + 1, ')');
ffStrbufSubstrBefore(&result->version, iEnd);
ffStrbufSubstrAfter(&result->version, iStart);
uint32_t iStart = ffStrbufFirstIndexC(&result->version, '(');
if (iStart < result->version.length)
{
uint32_t iEnd = ffStrbufNextIndexC(&result->version, iStart + 1, ')');
ffStrbufSubstrBefore(&result->version, iEnd);
ffStrbufSubstrAfter(&result->version, iStart);
}
}
}
}
else if (ffStrbufEqualS(&result->name, "launchd"))
#elif __APPLE__
if (ffStrbufEqualS(&result->name, "launchd"))
{
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
"/bin/launchctl",
@@ -66,6 +87,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
}
}
}
#endif
}
return NULL;
+4
View File
@@ -4,6 +4,10 @@
void ffDetectLocale(FFstrbuf* result)
{
ffStrbufAppendS(result, getenv("LC_ALL"));
if(result->length > 0)
return;
ffStrbufAppendS(result, getenv("LC_MESSAGES"));
if(result->length > 0)
return;
-1
View File
@@ -5,7 +5,6 @@
#include <string.h>
#define FF_DBUS_MPRIS_PREFIX "org.mpris.MediaPlayer2."
#define FF_DBUS_TIMEOUT_MILLISECONDS 35
#ifdef FF_HAVE_DBUS
#include "common/dbus.h"
+13 -17
View File
@@ -8,6 +8,7 @@
#include "detection/displayserver/displayserver.h"
#include "util/mallocHelper.h"
#include "util/stringUtils.h"
#include "util/linux/elf.h"
static const char* getSystemMonospaceFont(void)
{
@@ -286,6 +287,13 @@ static void detectXterm(FFTerminalFontResult* terminalFont)
ffFontInitValues(&terminalFont->font, fontName.chars, fontSize.chars);
}
static bool elfExtractStringsCallBack(const char* str, uint32_t len, void* userData)
{
if (!ffStrContains(str, "size=")) return true;
ffStrbufSetNS((FFstrbuf*) userData, len, str);
return false;
}
static void detectSt(FFTerminalFontResult* terminalFont, const FFTerminalResult* terminal)
{
FF_STRBUF_AUTO_DESTROY size = ffStrbufCreateF("/proc/%u/cmdline", terminal->pid);
@@ -306,30 +314,18 @@ static void detectSt(FFTerminalFontResult* terminalFont, const FFTerminalResult*
else
{
ffStrbufClear(&font);
if (ffProcessAppendStdOut(&font, (char* const[]) {
"strings",
terminal->exePath.chars,
NULL,
}) != NULL || font.length == 0)
const char* error = ffElfExtractStrings(terminal->exePath.chars, elfExtractStringsCallBack, &font);
if (error)
{
ffStrbufAppendS(&terminalFont->error, "Failed to run `strings st`");
ffStrbufAppendS(&terminalFont->error, error);
return;
}
// Search font config string in st binary
uint32_t middleIndex = ffStrbufFirstIndexS(&font, "size=");
if (middleIndex == font.length)
if (font.length == 0)
{
ffStrbufAppendS(&terminalFont->error, "No font config found in st binary");
return;
}
uint32_t startIndex = ffStrbufPreviousIndexC(&font, middleIndex, '\n');
if (startIndex == font.length) startIndex = 0;
uint32_t endIndex = ffStrbufNextIndexC(&font, middleIndex, '\n');
ffStrbufSubstrBefore(&font, endIndex);
ffStrbufSubstrAfter(&font, startIndex);
}
// JetBrainsMono Nerd Font Mono:pixelsize=12:antialias=true:autohint=true
@@ -485,6 +485,33 @@ static bool getTerminalVersionZed(FFstrbuf* exe, FFstrbuf* version)
#ifndef _WIN32
static bool getTerminalVersionKitty(FFstrbuf* exe, FFstrbuf* version)
{
#if defined(__linux__) || defined(__FreeBSD__)
char buffer[1024] = {};
if (
#ifdef __linux__
ffReadFileData(FASTFETCH_TARGET_DIR_USR "/lib64/kitty/kitty/constants.py", sizeof(buffer) - 1, buffer) ||
ffReadFileData(FASTFETCH_TARGET_DIR_USR "/lib/kitty/kitty/constants.py", sizeof(buffer) - 1, buffer)
#else
ffReadFileData(_PATH_LOCALBASE "/share/kitty/kitty/constants.py", sizeof(buffer) - 1, buffer)
#endif
)
{
// Starts from version 0.17.0
// https://github.com/kovidgoyal/kitty/blob/master/kitty/constants.py#L25
const char* p = memmem(buffer, sizeof(buffer) - 1, "version: Version = Version(", strlen("version: Version = Version("));
if (p)
{
p += strlen("version: Version = Version(");
int major, minor, patch;
if (sscanf(p, "%d,%d,%d", &major, &minor, &patch) == 3)
{
ffStrbufSetF(version, "%d.%d.%d", major, minor, patch);
return true;
}
}
}
#endif
char versionHex[64];
// https://github.com/fastfetch-cli/fastfetch/discussions/1030#discussioncomment-9845233
if (ffGetTerminalResponse(
+1
View File
@@ -44,6 +44,7 @@ FFVersionResult ffVersionResult = {
.architecture = FF_ARCHITECTURE,
.version = FASTFETCH_PROJECT_VERSION,
.versionTweak = FASTFETCH_PROJECT_VERSION_TWEAK,
.versionGit = FASTFETCH_PROJECT_VERSION_GIT,
.cmakeBuiltType = FASTFETCH_PROJECT_CMAKE_BUILD_TYPE,
.compileTime = __DATE__ ", " __TIME__,
.compiler =
+1
View File
@@ -9,6 +9,7 @@ typedef struct FFVersionResult
const char* architecture;
const char* version;
const char* versionTweak;
const char* versionGit;
const char* cmakeBuiltType;
const char* compileTime;
const char* compiler;
+1 -2
View File
@@ -1,5 +1,6 @@
#include "wifi.h"
#include "common/dbus.h"
#include "common/io/io.h"
#include "common/processing.h"
#include "common/properties.h"
#include "util/stringUtils.h"
@@ -177,8 +178,6 @@ static const char* detectWifiWithIw(FFWifiResult* item, FFstrbuf* buffer)
}
#if FF_HAVE_LINUX_WIRELESS
#include "common/io/io.h"
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
+1
View File
@@ -8,6 +8,7 @@
#define FASTFETCH_PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define FASTFETCH_PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define FASTFETCH_PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define FASTFETCH_PROJECT_VERSION_GIT "@PROJECT_VERSION_GIT@"
#define FASTFETCH_PROJECT_VERSION_TWEAK "@PROJECT_VERSION_TWEAK@"
#define FASTFETCH_PROJECT_VERSION_TWEAK_NUM @PROJECT_VERSION_TWEAK_NUM@
#define FASTFETCH_PROJECT_CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
+18
View File
@@ -0,0 +1,18 @@
$2 :@@@@@@@:
$2 @@@@@@@@@-
$2 .:%. @@@@@@@@@+. @%
$2 *@@@%+: :@@@@@@@%=: .=%@@@@@@=
$2 :@@@@@@##@@@@@@@@@%*+%@%+@@@@@@@+
$2 @@#$1####$2+@@@@@@@%:$1######$2=@@@@@@@@@-
$2 *@%$1######$2.@@@@@#$1#########$2-@@@@@@@@#.
$2 %@-$1#$2.@$1=$2:$1##$2+@@@@-$1###$2%@$1:$2=$1###$2*@#*+=-+#:
$2 @@.$1#$2@@*$1=$2:$1#$2-%%**-$1##$2%@@%$1*$2*$1###$2#=-
$2 @@-$1#$2@@@@+.-$3...$2:=.$1#$2%@@@@%$1###$2#-
$2 %@%$1##$2*#:$3.o.....o...$2-%@+$1###$2#@+ -:
$2 +@@*$1#$3....................$2+@@@@@@@@+
$2 @%:$3....................._:$2@@@@@@@=.
$2 .=:$3...............__*-=`.$2=@@@@@@#=.
$2 :+:$3....:==*__*-=`:..==-:$2#@@@@@%+:
$2 .--=-: $3+..::.....-: $2=%@*=:
$2 :........-
$2 .:...--.
+16
View File
@@ -0,0 +1,16 @@
.
x/A\x
Z#@#?P`.
/@$R/.:.',
_ ($@`.:::.) _
_-=t'''`-.g$(.::::.!-aZ#$#Kko,
V$#6..::::.~l.::.<&#p***q##$p'
'9#$b,:::::::::.%P~'.:::.`~v'
"<#$&b,.':::'./'.:::::::.>'
`~*q@#&b+=- -=+x.,''_.'
z+'.:::',).:.`~q@6x,
/.:::::',Z!.:::.`*q&x
i'.:::',<J?`.':::.\#$&,
lo._,xd$#%' \'::::.@$#)
V@#$##@%P' ~+,''/#$#!
`~***~^' `'"****
+7
View File
@@ -0,0 +1,7 @@
,x.
;&?^$2.$1
.-e~^+7' $2)$1adbx,
\#\$2. $1`,*~ ~*/
`~*+-'-<ay,$2^$1
$2,/ $1,%$2\ $1`\&,
!&UP* $2+.$1/%?
+33
View File
@@ -2334,6 +2334,18 @@ static const FFlogo L[] = {
.colorKeys = FF_COLOR_FG_WHITE,
.colorTitle = FF_COLOR_FG_WHITE,
},
// LinuxFromScratch
{
.names = {"LinuxFromScratch", "lfs"},
.lines = FASTFETCH_DATATEXT_LOGO_LFS,
.colors = {
FF_COLOR_FG_WHITE,
FF_COLOR_FG_BLACK,
FF_COLOR_FG_YELLOW,
},
.colorKeys = FF_COLOR_FG_BLACK,
.colorTitle = FF_COLOR_FG_YELLOW,
},
// LinuxSmall
{
.names = {"Linux_small", "linux-generic_small"},
@@ -4440,6 +4452,27 @@ static const FFlogo V[] = {
.colorKeys = FF_COLOR_FG_YELLOW,
.colorTitle = FF_COLOR_FG_YELLOW,
},
// Vanilla2
{
.names = {"vanilla2", "vanilla-os2", "vanilla-linux2"},
.type = FF_LOGO_LINE_TYPE_ALTER_BIT,
.lines = FASTFETCH_DATATEXT_LOGO_VANILLA2,
.colors = {
FF_COLOR_FG_YELLOW,
},
.colorKeys = FF_COLOR_FG_YELLOW,
.colorTitle = FF_COLOR_FG_YELLOW,
},
// VanillaSmall
{
.names = {"vanilla-small", "vanilla-os-small", "vanilla-linux-small"},
.type = FF_LOGO_LINE_TYPE_SMALL_BIT,
.lines = FASTFETCH_DATATEXT_LOGO_VANILLA_SMALL,
.colors = {
FF_COLOR_FG_LIGHT_YELLOW,
FF_COLOR_FG_YELLOW,
},
},
// Venom
{
.names = {"Venom"},
+6
View File
@@ -52,6 +52,12 @@ void ffPrintColors(FFColorsOptions* options)
ffStrbufClear(&result);
}
#ifdef __linux__
// Required by Linux Console for light background to work
if (options->symbol == FF_COLORS_SYMBOL_BACKGROUND)
ffStrbufAppendS(&result, "\e[5m");
#endif
// 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++)
{
+7 -1
View File
@@ -421,7 +421,13 @@ void ffInitGPUOptions(FFGPUOptions* options)
ffOptionInitModuleArg(&options->moduleArgs, "󰾲");
options->driverSpecific = false;
options->detectionMethod = FF_GPU_DETECTION_METHOD_AUTO;
options->detectionMethod =
#if defined(__x86_64__) || defined(__i386__)
FF_GPU_DETECTION_METHOD_PCI
#else
FF_GPU_DETECTION_METHOD_AUTO
#endif
;
options->temp = false;
options->hideType = FF_GPU_TYPE_UNKNOWN;
options->tempConfig = (FFColorRangeConfig) { 60, 80 };
+1 -1
View File
@@ -89,7 +89,7 @@ void ffGenerateVersionJsonResult(FF_MAYBE_UNUSED FFVersionOptions* options, yyjs
yyjson_mut_obj_add_str(doc, obj, "sysName", result->sysName);
yyjson_mut_obj_add_str(doc, obj, "architecture", result->architecture);
yyjson_mut_obj_add_str(doc, obj, "version", result->version);
yyjson_mut_obj_add_str(doc, obj, "versionTweak", result->versionTweak);
yyjson_mut_obj_add_str(doc, obj, "versionGit", result->versionGit);
yyjson_mut_obj_add_str(doc, obj, "cmakeBuiltType", result->cmakeBuiltType);
yyjson_mut_obj_add_str(doc, obj, "compileTime", result->compileTime);
yyjson_mut_obj_add_str(doc, obj, "compiler", result->compiler);
+4
View File
@@ -66,6 +66,8 @@ const char* ffOptionsParseLibraryJsonConfig(FFOptionsLibrary* options, yyjson_va
ffStrbufSetS(&options->libDdcutil, yyjson_get_str(val));
else if (ffStrEqualsIgnCase(key, "drm"))
ffStrbufSetS(&options->libdrm, yyjson_get_str(val));
else if (ffStrEqualsIgnCase(key, "elf"))
ffStrbufSetS(&options->libelf, yyjson_get_str(val));
#endif
else
@@ -131,6 +133,8 @@ bool ffOptionsParseLibraryCommandLine(FFOptionsLibrary* options, const char* key
ffOptionParseString(key, value, &options->libDdcutil);
else if(ffStrEqualsIgnCase(subkey, "drm"))
ffOptionParseString(key, value, &options->libdrm);
else if(ffStrEqualsIgnCase(subkey, "elf"))
ffOptionParseString(key, value, &options->libelf);
#endif
else
+1
View File
@@ -32,6 +32,7 @@ typedef struct FFOptionsLibrary
FFstrbuf libPulse;
FFstrbuf libDdcutil;
FFstrbuf libdrm;
FFstrbuf libelf;
#endif
} FFOptionsLibrary;
+84
View File
@@ -0,0 +1,84 @@
#include "elf.h"
#ifdef FF_HAVE_ELF
#include "common/io/io.h"
#include "common/library.h"
#include "util/stringUtils.h"
#include <libelf.h>
#include <fcntl.h>
const char* ffElfExtractStrings(const char* elfFile, bool (*cb)(const char* str, uint32_t len, void* userdata), void* userdata)
{
FF_LIBRARY_LOAD(libelf, &instance.config.library.libelf, "dlopen libelf" FF_LIBRARY_EXTENSION " failed", "libelf" FF_LIBRARY_EXTENSION, 1);
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_version)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_begin)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_getshdrstrndx)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_nextscn)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf64_getshdr)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf32_getshdr)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_getdata)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_strptr)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libelf, elf_end)
if (ffelf_version(EV_CURRENT) == EV_NONE) return "elf_version() failed";
FF_AUTO_CLOSE_FD int fd = open(elfFile, O_RDONLY, 0);
if (fd < 0) return "open() failed";
Elf* elf = ffelf_begin(fd, ELF_C_READ, NULL);
if (elf == NULL) return "elf_begin() failed";
size_t shstrndx = 0;
if (ffelf_getshdrstrndx(elf, &shstrndx) < 0)
{
ffelf_end(elf);
return "elf_getshdrstrndx() failed";
}
Elf_Scn* scn = NULL;
while ((scn = ffelf_nextscn(elf, scn)) != NULL)
{
Elf64_Shdr* shdr64 = ffelf64_getshdr(scn);
Elf32_Shdr* shdr32 = NULL;
if (shdr64 == NULL)
{
shdr32 = ffelf32_getshdr(scn);
if (shdr32 == NULL) continue;
}
const char* name = ffelf_strptr(elf, shstrndx, shdr64 ? shdr64->sh_name : shdr32->sh_name);
if (name == NULL || !ffStrEquals(name, ".rodata")) continue;
Elf_Data* data = ffelf_getdata(scn, NULL);
if (data == NULL) continue;
for (size_t off = 0; off < data->d_size; ++off)
{
const char* p = (const char*) data->d_buf + off;
if (*p == '\0') continue;
uint32_t len = (uint32_t) strlen(p);
if (*p >= ' ' && *p <= '~') // Ignore control characters
{
if (!cb(p, len, userdata)) break;
}
off += len;
}
break;
}
ffelf_end(elf);
return NULL;
}
#else
const char* ffElfExtractStrings(const char* elfFile, bool (*cb)(const char* str, uint32_t len, void* userdata), void* userdata)
{
FF_UNUSED(elfFile, cb, userdata);
return "Fastfetch was built without libelf support";
}
#endif
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include "fastfetch.h"
const char* ffElfExtractStrings(const char* elfFile, bool (*cb)(const char* str, uint32_t len, void* userdata), void* userdata);