Skip to content
oooneaPublic

About

Customizable terminal system information for Linux and macOS. Written in Rust with zero crate dependencies.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

purefetch

CI crates.io License: MIT OR Apache-2.0 Rust Dependencies: 0

Your system at a glance, from the terminal. purefetch pairs a distribution logo with a compact overview of your hardware, desktop and resource usage. It runs on Linux and macOS and is written in Rust with zero crate dependencies.

  • Make it yours. Choose the information and its order, select a bundled logo, or supply your own artwork and command output.
  • Across systems. Linux on x86_64, ARM64, RISC-V64 and LoongArch64; macOS on Apple Silicon and Intel.
  • Useful details. Native package counts, Nix profile closures, ZFS pool usage and macOS memory and APFS reporting.
  • Terminal friendly. Colors adapt to redirected output, values fit the terminal width, and external probes have a two-second deadline.

Inspired by fastfetch. The implementation uses Rust's standard library, direct Linux syscalls and libSystem on macOS. Some information sources query installed system commands; zero crate dependencies does not mean zero external probes.

purefetch running on NixOS

         _==_      ====;   _==_            ooonea@unicorn
         =@@@|      =@@@| ;@@@=            ──────────────
          =@@@=      =@@@@@@@=             OS            NixOS 26.05 (yarara) x86_64
      =====@@@@@======'@@@@@=              Host          ThinkPad P53 (20QQS0JD01)
     =@@@@@@@@@@@@@@@@@_@@@@_    _|_       Kernel        6.18.52
     `````_|||=`````````'@@@@_  _@@=_      Uptime        20 hours, 36 mins
         _@@@=`           %@@@,_@@@@`      Shell         bash 5.3.9
        ;@@@=              =@@_@@@@`       Display       1920x1080 (eDP-1)
_@@@@@@@@@@=                *|@@@@@@@@@_   DE            umbriel
'@@@@@@@@@=|                =@@@@@@@@@@'   Terminal      kitty 0.48.2
    _@@@@'@@=_            _=@@@=           CPU           Intel(R) Core(TM) i7-9850H @ 4.60 GHz
   _@@@@`'@@@@_          _@@@@'            GPU           Quadro RTX 3000
    %@@`  '@@@@__________||||_______       Memory        34.32 GiB / 62.61 GiB (55%)
     *     '@@@@_@@@@@@@@@@@@@@@@@=        Swap          0 B / 15.65 GiB (0%)
           ;@@@@@|=======@@@@=====         Disk (zroot)  302.74 GiB / 928.00 GiB (33%)
          =@@@@@@@|      =@@@=             Locale        C.UTF-8
         =@@@= =@@@=_     '@@@=            Battery       77% (Not charging)
         '=='   '====      '==`

Install

With a Rust toolchain (1.70+):

cargo install purefetch

Or straight from the repo (latest main):

cargo install --git https://github.com/ooonea/purefetch

Or build from source:

git clone https://github.com/ooonea/purefetch
cd purefetch
cargo build --release
./target/release/purefetch
# optional: install to ~/.cargo/bin
cargo install --path .

With Nix

nix run github:ooonea/purefetch

Or add the flake as an input and use purefetch.packages.${system}.default (built for x86_64-linux, aarch64-linux, aarch64-darwin and x86_64-darwin; there is also an overlays.default).

Targets Linux on x86_64, aarch64, riscv64, and loongarch64, and macOS (Apple Silicon and Intel).

Usage

purefetch [OPTIONS]

-l, --logo <NAME>       logo: auto (default), or a distro name (see below)
    --logo-file <PATH>  use a custom logo, read verbatim from a file
    --logo-exec <CMD>   use a custom logo from a command's output (dynamic)
    --modules <LIST>    comma-separated modules to show ('-' = separator)
    --exec <LABEL:CMD>  add a custom line from a shell command (ref in --modules)
    --config <PATH>     read options from PATH
    --no-config         ignore any config file
    --no-logo           do not print any logo
    --no-color          disable ANSI colors
    --no-color-blocks   hide the trailing ANSI color blocks
-V, --version           print version and exit
-h, --help              print this help and exit

Colors are disabled automatically when stdout is not a terminal (or when NO_COLOR is set), so purefetch | cat produces clean, unstyled text.

Bundled logos: arch, ubuntu, fedora, asahi, debian, mint, manjaro, pop, opensuse, alpine, void, nixos, gentoo, endeavouros, kali, elementary, zorin, artix, rocky, almalinux, centos, devuan, mx, garuda, macos (alias apple), tux (and none). auto picks one from /etc/os-release on Linux (falling back to tux) and always the Apple logo on macOS. Fedora Asahi Remix uses the Asahi logo. Use --logo nixos_small for the compact, 20-column NixOS variant.

Configuration

Any option can also live in a config file — one key value per line — so plain purefetch reproduces your setup (a login banner and an interactive prompt then show the same thing):

# ~/.config/purefetch/config
logo-exec /home/me/.config/purefetch/gen-logo.sh
no-color-blocks
modules os,host,kernel,-,cpu,memory,swap,-,shell
exec Pool:zpool list -H -o health,cap zroot

purefetch reads $PUREFETCH_CONFIG, then ~/.config/purefetch/config, then /etc/purefetch/config. Command-line flags override the file; --no-config ignores it.

Repeated exec labels are case-insensitive; the last definition wins, including when a command-line definition replaces one from the config file.

External commands (including exec and logo-exec) have a two-second deadline; failed or timed-out commands produce no data.

Detected info

Title (user@host), OS, Host, Kernel, Uptime, Packages, Shell, Display, DE, WM, Terminal, CPU, GPU, Memory, Swap, Disk (/), Locale, Battery, and the ANSI color blocks. Any module whose data is unavailable (e.g. Battery on a desktop, Swap with no swap) is silently skipped.

The package module supports dpkg, RPM, pacman, apk, Portage, XBPS, Flatpak (applications), Snap, Homebrew, MacPorts and Nix. RPM, XBPS and Nix use native read-only queries with the same two-second deadline as other external probes. Nix reports versioned runtime closure outputs per system, default or user profile, including dependencies but excluding documentation and development outputs; it does not count every path left in the store. Profiles resolving to the same store path are queried once.

Notable details

  • Zero dependencies. The whole tool is std + the platform layer in src/sys/ (raw syscalls on Linux, libSystem FFI on macOS).
  • ZFS-aware. Memory is MemTotal - MemAvailable (matching free/htop) — the ARC counts as used because it genuinely occupies RAM. On a ZFS root, Disk reports the whole pool via zpool list (labelled Disk (<pool>)), not just the root dataset's few GiB.
  • macOS semantics match the natives. Memory follows vm_stat/Activity Monitor (total minus really-free and file-backed pages), Disk (/) reports the shared APFS container with used = total - available (like fastfetch), Display lists native pixels via CoreGraphics, and Host shows the device tree's marketing name over the board id — no model lookup table to age.
  • Process-parent detection. Shell and Terminal walk the parent chain (/proc/<pid>/stat+comm on Linux, proc_pidinfo on macOS), with environment-variable fallbacks ($TERM, $TERM_PROGRAM, $KITTY_WINDOW_ID, ...) for the terminal.
  • Best-effort detection. Missing data drops its line; external command probes time out after two seconds.

Architecture

src/
  main.rs        arg parsing, module ordering, title/separators/color blocks, dispatch
  sys/
    mod.rs       platform-layer API (disk_usage, term_width, hostname, ppid_comm, ...)
    linux.rs     raw Linux syscalls (x86_64, aarch64, riscv64, loongarch64): statfs, ioctl, kill
    darwin.rs    libSystem FFI: statfs, sysctl, mach VM stats, libproc, CoreGraphics
  util.rs        file helpers, subprocess helper, byte/percent formatting
  color.rs       ANSI palette
  logo.rs        OS ASCII logos + selection (generated by examples/genlogos.rs)
  render.rs      logo-left / info-right layout, ANSI-aware width & truncation
  detect/
    mod.rs       Row/Rows contract + module registry
    *.rs         one module per info line (os, cpu, gpu, memory, ...), cfg-split per OS

Adding an info source is one file: implement pub fn detect() -> crate::detect::Rows in src/detect/<name>.rs and register it in src/main.rs. Adding a distro logo is one text file in assets/logos/ followed by cargo run --example genlogos.

Contributing

See CONTRIBUTING.md. New distro logos, more package managers, extra info modules, and support for other CPU architectures are all welcome — please keep the zero-dependency rule and run cargo fmt before submitting.

Disclosure

purefetch was developed with AI assistance from Claude Code and OpenAI Codex, under human direction. Changes are reviewed and tested; CI includes native Linux x86_64 and both macOS architectures, Linux ARM64/RISC-V64/LoongArch64 execution under QEMU, and Rust 1.70 compatibility checks.

Credits

The bundled logos are traditional ASCII adaptations of the projects' original artwork. Sources, authors and separate artwork terms are listed in CREDITS.md. Names and marks identify the reported operating system; they do not imply endorsement of purefetch.

License

The program code is licensed under either of

at your option. Logo artwork retains the separate terms in CREDITS.md.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Customizable terminal system information for Linux and macOS. Written in Rust with zero crate dependencies.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages