Zfetch -- Another system information fetcher written in Zig

zfetch (:high_voltage:) is a lightweight, high-performance system information fetcher inspired by the fastfetch.

The “z” stands for both Zig (the language it’s written in) and zap (:high_voltage: lightning-fast). It aims to be extremely fast by avoiding external process calls and using native C APIs or virtual filesystems instead.

  • Cross-platform: Supports macOS, Linux, and FreeBSD.
  • Detailed Memory Info:
    • On macOS: Provides breakdown of App Memory, Wired Memory, and Compressed Memory (matching Activity Monitor).
    • On Linux: Provides Swap usage details.
    • On FreeBSD: Uses sysctl for memory and ACPI for battery status.
  • Hardware Insights: Displays CPU core distribution (Performance vs. Efficiency cores on Apple Silicon), GPU (macOS), and Page Size.
  • High Performance: Uses sysctl, IOKit, CoreFoundation on macOS, procfs, sysfs on Linux, and sysctl on FreeBSD.

Demo

Install

curl -fsSL https://zigcli.liujiacai.net/install.sh | sh -s -- --bins "zfetch"

Source code

6 Likes