Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: v2.22.0 #1215

Merged
merged 42 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e0d733f
DisplayServer (macOS): fix building on ancient macOS version
CarterLi Aug 15, 2024
c8e4de9
CPU (Linux): silence complier warnings
CarterLi Aug 15, 2024
da50a48
Merge remote-tracking branch 'origin/master' into dev
CarterLi Aug 15, 2024
bbb873c
Doc: Improve installation instructions in the README (#1182)
AlbydST Aug 15, 2024
9d27106
Packaging: update debian stuff [ci skip]
CarterLi Aug 16, 2024
b46d9d8
Logo (Builtin): Add Lingmo OS Logo (#1192)
lingmo-dream Aug 16, 2024
f71c4f6
TerminalShell (Linux): improve performance of GNOME Terminal version …
CarterLi Aug 17, 2024
fbfe2b2
CPU (Linux): tidy
CarterLi Aug 18, 2024
4189025
CPU: detect frequency by cpuid (x86 only)
CarterLi Aug 18, 2024
8641442
CMake: fix build on Android
CarterLi Aug 20, 2024
31ead52
Doc: update readme [ci skip]
CarterLi Aug 20, 2024
8114856
Logo (Builtin): Sleeper OS zzzZZZ (#1199)
Princess-Sunset-Shimmer Aug 20, 2024
8559ab2
Colors (Linux): support tmux in linux TTY
CarterLi Aug 20, 2024
4860bc3
Editor: improve performance of version detection
CarterLi Aug 20, 2024
543eed9
Logo (Builtin): add SleeperOS_small
CarterLi Aug 20, 2024
dd2d343
Global: fix build on Windows
CarterLi Aug 20, 2024
099a390
Disk (Linux): fix hang in WSL when custom format is used
CarterLi Aug 20, 2024
1c83759
Presets: update examples/23.jsonc
CarterLi Aug 20, 2024
22e25d0
Binary: support macOS
CarterLi Aug 21, 2024
d10dd20
CPU (Android): try support old armv7 smart phone
CarterLi Aug 21, 2024
591dba8
CPU (Linux): don't parse unnecessary lines on certain platforms
CarterLi Aug 21, 2024
9690501
CPU (Linux): support loongarch
CarterLi Aug 22, 2024
e66a83a
Version: support loongarch
CarterLi Aug 22, 2024
17deaf9
CPU (Linux): make "Hardware :" arm specific
CarterLi Aug 22, 2024
cf9bd0f
Loadavg (Linux): read `/proc/loadavg` instead of `/proc/uptime`
CarterLi Aug 22, 2024
b4aac9d
Binary: support Windows
CarterLi Aug 22, 2024
e199a2f
Editor: fix bug of executable searching
CarterLi Aug 23, 2024
893b3a6
Fastfetch: don't enable locale for `LC_NUMERIC`
CarterLi Aug 23, 2024
f22b8ed
TerminalShell: ignore the parent process if `$FFTS_IGNORE_PARENT` is …
CarterLi Aug 23, 2024
b5695b5
CPU (Linux): add code name of Apple M4
CarterLi Aug 23, 2024
df873a1
CPU (Windows): fix compiling errors
CarterLi Aug 23, 2024
a54cbee
Locale: remove usage of LC_MESSAGE
CarterLi Aug 23, 2024
34bc662
LocalIP: detect ethernet speed
CarterLi Aug 24, 2024
c8d85e0
Editor (SunOS): enable libelf on SunOS
CarterLi Aug 24, 2024
ce7ecd3
LocalIP: make link speed formattable
CarterLi Aug 24, 2024
e6fb545
LocalIP (Linux): try fixing musl build
CarterLi Aug 24, 2024
f6ccbf7
LocalIP (Android): fix build
CarterLi Aug 24, 2024
788cad3
DiskIO (Linux): fix possible segfault
CarterLi Aug 24, 2024
d15d4c6
Display: honor `preciseRefreshRate` in custom format
CarterLi Aug 25, 2024
773b8db
Completion: add zsh-completion (#1213)
AtifChy Aug 25, 2024
5b78b2e
Packages (Linux): add Linglong support (#1214)
xoascf Aug 26, 2024
11cfdba
Release: v2.22.0
CarterLi Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# 2.22.0

Features:
* Small performance improvements (Terminal, Editor)
* Improve arm32 and loongarch support (CPU, Linux)
* Ignore the parent process if env `$FFTS_IGNORE_PARENT` is set to `1` (Shell)
* Add code name of Apple M4 (CPU, Linux)
* Add ethernet speed rate detection support (LocalIP)
* Add zsh completion script
* Add Linglong package manager detection support (Packages, Linux)

Bugfixes:
* Fix building on macOS 10.14
* Fix tmux in linux TTY (Colors)
* Fix hang in WSL when custom format is used (Disk, Linux)
* Fix `/proc/loadavg` parsing (Loadavg, Linux)
* Disable use of `LC_NUMERIC` locale settings to fix parsing of decimal numbers
* Fix possible segfault (DiskIO, Linux)
* Honor `preciseRefreshRate` in custom format (Display)

Logos:
* Add Lingmo OS
* Add Sleeper OS

# 2.21.3

Bugfixes:
Expand Down
21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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.3
VERSION 2.22.0
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
Expand Down Expand Up @@ -69,7 +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_ELF "Enable libelf" ON "LINUX OR FreeBSD OR ANDROID" 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)
Expand Down Expand Up @@ -401,6 +401,7 @@ set(LIBFASTFETCH_SRC
src/util/base64.c
src/util/FFlist.c
src/util/FFstrbuf.c
src/util/path.c
src/util/platform/FFPlatform.c
src/util/smbiosHelper.c
)
Expand Down Expand Up @@ -481,7 +482,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
src/util/binary_linux.c
)
elseif(ANDROID)
list(APPEND LIBFASTFETCH_SRC
Expand Down Expand Up @@ -543,6 +544,7 @@ elseif(ANDROID)
src/detection/wmtheme/wmtheme_nosupport.c
src/detection/camera/camera_android.c
src/util/platform/FFPlatform_unix.c
src/util/binary_linux.c
)
elseif(FreeBSD)
list(APPEND LIBFASTFETCH_SRC
Expand Down Expand Up @@ -621,7 +623,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
src/util/binary_linux.c
)
elseif(APPLE)
list(APPEND LIBFASTFETCH_SRC
Expand Down Expand Up @@ -687,6 +689,7 @@ elseif(APPLE)
src/util/apple/cf_helpers.c
src/util/apple/osascript.m
src/util/platform/FFPlatform_unix.c
src/util/binary_apple.c
)
elseif(WIN32)
list(APPEND LIBFASTFETCH_SRC
Expand Down Expand Up @@ -753,6 +756,7 @@ elseif(WIN32)
src/util/windows/unicode.c
src/util/windows/wmi.cpp
src/util/platform/FFPlatform_windows.c
src/util/binary_windows.c
)
elseif(SunOS)
list(APPEND LIBFASTFETCH_SRC
Expand Down Expand Up @@ -829,7 +833,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
src/util/binary_linux.c
)
endif()

Expand Down Expand Up @@ -1135,6 +1139,7 @@ elseif(WIN32)
PRIVATE "setupapi"
PRIVATE "hid"
PRIVATE "wtsapi32"
PRIVATE "imagehlp"
)
elseif(FreeBSD)
target_link_libraries(libfastfetch
Expand Down Expand Up @@ -1332,6 +1337,12 @@ install(
RENAME "${CMAKE_PROJECT_NAME}"
)

install(
FILES "${CMAKE_SOURCE_DIR}/completions/${CMAKE_PROJECT_NAME}.zsh"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/zsh/site-functions"
RENAME "_${CMAKE_PROJECT_NAME}"
)

install(
FILES "${CMAKE_SOURCE_DIR}/completions/${CMAKE_PROJECT_NAME}.fish"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/fish/vendor_completions.d"
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ There are [screenshots on different platforms](https://github.com/fastfetch-cli/
Some distros packaged an outdated fastfetch version. Older version receive no support, so please try always to use the latest version.

* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
* Debian: `sudo apt install fastfetch` (for Debian 13 or newer)
* Debian: `apt install fastfetch` (for Debian 13 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`
* Arch Linux: `pacman -S fastfetch`
* Fedora: `dnf install fastfetch`
* Gentoo: `emerge --ask app-misc/fastfetch`
* Alpine: `apk add --upgrade fastfetch`
* NixOS: `nix-shell -p fastfetch`
* openSUSE: `sudo zypper install fastfetch`
* ALT Linux: `sudo apt-get install fastfetch`
* openSUSE: `zypper install fastfetch`
* ALT Linux: `apt-get install fastfetch`
* Exherbo: `cave resolve --execute app-misc/fastfetch`
* GNU Guix: `guix install fastfetch`
* Solus: `eopkg install fastfetch`
* Slackware: `sbopkg -i fastfetch`
* Void Linux: `xbps-install fastfetch`
* Venom Linux: `scratch install fastfetch`

Replace sudo with doas depending on what you use.
You may need `sudo`, `doas` or `sup` to run these commands.

[See also if fastfetch has been packaged for your favorite Linux distro](#Packaging).

Expand All @@ -54,8 +60,9 @@ If fastfetch is not packaged for your distro or an outdated version is packaged,
### Windows

* [scoop](https://scoop.sh/#/apps?q=fastfetch): `scoop install fastfetch`
* [Chocolatey](https://community.chocolatey.org/packages/fastfetch): `choco install fastfetch`
* [winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/f/Fastfetch-cli/Fastfetch): `winget install fastfetch`
* [MSYS2 MinGW](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-fastfetch): `pacman -S mingw-w64-<subsystem>-<arch>-fastfetch`
* [MSYS2 MinGW](https://packages.msys2.org/base/mingw-w64-fastfetch): `pacman -S mingw-w64-<subsystem>-<arch>-fastfetch`

You may also download the program directly from [the GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) in the form of an archive file.

Expand Down
97 changes: 97 additions & 0 deletions completions/fastfetch.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#compdef fastfetch

function _fastfetch() {
local state

local -a opts
opts=(${(f)"$(
python <<EOF
import json
import subprocess
import 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.get("pseudo", False):
continue

if "short" in flag:
command_prefix = f"""-{flag["short"]}[{flag["desc"]}]"""
print_command(command_prefix, flag)

if "long" in flag:
command_prefix = f"""--{flag["long"]}[{flag["desc"]}]"""
print_command(command_prefix, flag)


def print_command(command_prefix: str, flag: dict):
if "arg" in flag:
type: str = flag["arg"]["type"]
if type == "bool":
print(f"{command_prefix}:bool:(true false)")
elif type == "color":
print(f"{command_prefix}:color:(black red green yellow blue magenta cyan white default)")
elif type == "command":
print(f"{command_prefix}:module:->modules")
elif type == "config":
print(f"{command_prefix}:presets:->presets")
elif type == "enum":
temp: str = " ".join(flag["arg"]["enum"])
print(f'{command_prefix}:type:( {temp} )')
elif type == "logo":
print(f"{command_prefix}:logo:->logo")
elif type == "structure":
print(f"{command_prefix}:structure:->structure")
elif type == "path":
print(f"{command_prefix}:path:_files -/")
else:
print(f"{command_prefix}:")
else:
print(f"{command_prefix}")


if __name__ == "__main__":
try:
main()
except Exception:
sys.exit(1)
EOF
)"})

_arguments -C "$opts[@]"

case $state in
modules)
local -a modules=( ${(f)"$(fastfetch --list-modules autocompletion)"} )
modules=( ${(L)^modules%%:*}-format format color )
_describe 'module' modules
;;
presets)
local -a presets=(
${$(fastfetch --list-presets autocompletion):#.*}
"none:Disable loading config file"
)
_describe 'preset' presets
;;
structure)
local -a structures=( ${(f)"$(fastfetch --list-modules autocompletion)"} )
_describe 'structure' structures
;;
logo)
local -a logos=(
$(fastfetch --list-logos autocompletion)
"none:Don't print logo"
"small:Print small ascii logo if available"
)
_describe 'logo' logos
;;
esac
}

_fastfetch "$@"
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
fastfetch (2.21.3) jammy; urgency=medium

* Update to 2.21.3

-- Carter Li <zhangsongcui@live.cn> Thu, 15 Aug 2024 16:14:52 +0800

fastfetch (2.21.2) jammy; urgency=medium

* Update to 2.21.2
Expand Down
2 changes: 1 addition & 1 deletion debian/files
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fastfetch_2.21.2_source.buildinfo universe/utils optional
fastfetch_2.21.3_source.buildinfo universe/utils optional
22 changes: 14 additions & 8 deletions presets/examples/23.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,51 @@
},
"separator": ""
},
"modules": [
"modules": [
{
"type": "kernel",
"key": "Vanilla ",
"key": "[_Kernel___> ",
"keyColor": "blue"
},
{
"type": "packages",
"outputColor": "white",
"key": " [_Packages_> ",
"keyColor": "green"
},
{
"type": "localip",
"outputColor": "white",
"key": " [_Local_IP_> ",
"keyColor": "green"
},
{
"type": "cpu",
"key": " [_CPU______> ",
"keyColor": "magenta"
},
{
"type": "memory",
"format": "[{3}] {1} / {2}",
"key": " [_RAM______> ",
"keyColor": "magenta"
},
{
"type": "swap",
"format": "[{3}] {1} / {2}",
"key": " [_SWAP_____> ",
"keyColor": "magenta"
},
{
"type": "disk",
"format": "[{3}] {1} / {2} {9}",
"key": " [_Disk_____> ",
"keyColor": "magenta"
},
{
"type": "battery",
"format": "[{4}] {5}",
"key": " [_Battery__> ",
"keyColor": "magenta"
},
"break",
{
"type":"colors",
"type": "colors",
"paddingLeft": 9,
"symbol": "circle"
}
Expand Down
4 changes: 0 additions & 4 deletions src/common/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ void ffInitInstance(void)
#else
// Never use `setlocale(LC_ALL, "")`
setlocale(LC_TIME, "");
setlocale(LC_NUMERIC, "");
#ifdef LC_MESSAGES
setlocale(LC_MESSAGES, "");
#endif
#endif

initState(&instance.state);
Expand Down
1 change: 1 addition & 0 deletions src/detection/cpu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const char* ffCPUAppleCodeToName(uint32_t code)
case 6030: return "Apple M3 Pro";
case 6031:
case 6034: return "Apple M3 Max";
case 8132: return "Apple M4";
default: return "Apple Silicon";
}
}
27 changes: 27 additions & 0 deletions src/detection/cpu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,30 @@ typedef struct FFCPUResult

const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu);
const char* ffCPUAppleCodeToName(uint32_t code);


#if defined(__x86_64__) || defined(__i386__)

#include <cpuid.h>

// WARNING: CPUID may report frequencies of efficient cores
inline static const char* ffCPUDetectSpeedByCpuid(FFCPUResult* cpu)
{
uint32_t base = 0, max = 0, bus = 0, unused = 0;
if (!__get_cpuid(0x16, &base, &max, &bus, &unused))
return "Unsupported instruction";

// cpuid returns 0 MHz when hyper-v is enabled
if (base) cpu->frequencyBase = base;
if (max) cpu->frequencyMax = max;
return NULL;
}

#else

inline static const char* ffCPUDetectSpeedByCpuid(FF_MAYBE_UNUSED FFCPUResult* cpu)
{
return "Unsupported platform";
}

#endif
2 changes: 2 additions & 0 deletions src/detection/cpu/cpu_bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
}
}

ffCPUDetectSpeedByCpuid(cpu);

for (uint16_t i = 0; i < cpu->coresLogical; ++i)
{
ffStrbufClear(&buffer);
Expand Down
Loading
Loading