~sntx/nx-fetch

A configurable fetch tool written in Rust
fix: cachix url after name change
ci: updated tool name
docs: update project name

clone

read-only
https://git.sr.ht/~sntx/nx-fetch
read/write
git@git.sr.ht:~sntx/nx-fetch

You can also use your local clone with git send-email.

nx-fetch nx-fetch status

A minimal, fast and batteries included fetcher!

nx-fetch

image of nx-fetch prompt

#Installation

Cargo
cargo install --git https://git.sr.ht/~sntx/nx-fetch --locked
Cargo (manual)
git clone https://git.sr.ht/~sntx/nx-fetch && cd nx-fetch
cargo install --path . --locked
Nix Shell
nix shell sourcehut:~sntx/nx-fetch

#Usage

A minimal, fast and batteries included fetcher!

Usage: nx-fetch [OPTIONS] [MODULES]...

Arguments:
  [MODULES]...  A list of module names nx-fetch should display [possible values: colours, colours-bright, colours-dual, cpu, disk, disks, desktop, empty, host, kernel, memory, os, shell, term, terminal, title, uptime, user]

Options:
      --no-module-names
          Whether to hide the module names
  -l, --logo <LOGO>
          Path to text file with ascii art to use as the logo
      --no-logo
          Whether to hide the logo
      --padding-before <PADDING_BEFORE>
          Padding before the fetch [default: 2]
      --padding-between <PADDING_BETWEEN>
          Padding between the logo and the text [default: 2]
  -r, --raw
          Only print raw module output (same as `--no-logo --no-module-names --padding-before 0`, takes precedence over those args)
  -h, --help
          Print help
  -V, --version
          Print version

#Performance

nx-fetch 0.2.0 has been tested with hyperfine.

You can test nx-fetch against other popular fetchers by running:

nix run .#benchmark
$ nix run .#benchmark
Benchmark 1: nx-fetch
  Time (mean ± σ):       3.8 ms ±   0.4 ms    [User: 0.7 ms, System: 2.2 ms]
  Range (min  max):     2.2 ms    6.5 ms    1132 runs

Benchmark 2: afetch
  Time (mean ± σ):       5.9 ms ±   0.5 ms    [User: 3.2 ms, System: 2.6 ms]
  Range (min  max):     2.9 ms   11.1 ms    561 runs

Benchmark 3: bunnyfetch
  Time (mean ± σ):       4.7 ms ±   0.4 ms    [User: 1.6 ms, System: 3.0 ms]
  Range (min  max):     3.0 ms    7.4 ms    764 runs

Benchmark 4: fastfetch
  Time (mean ± σ):      47.1 ms ±   4.9 ms    [User: 17.5 ms, System: 20.8 ms]
  Range (min  max):    39.6 ms   58.4 ms    60 runs

Benchmark 5: inxi
  Time (mean ± σ):     620.3 ms ±   9.0 ms    [User: 163.5 ms, System: 98.7 ms]
  Range (min  max):   609.5 ms  637.9 ms    10 runs

Benchmark 6: neofetch
  Time (mean ± σ):     545.1 ms ±  50.4 ms    [User: 245.4 ms, System: 197.9 ms]
  Range (min  max):   473.6 ms  620.8 ms    10 runs

Benchmark 7: pfetch
  Time (mean ± σ):     139.8 ms ±  18.9 ms    [User: 66.1 ms, System: 33.2 ms]
  Range (min  max):   107.3 ms  172.7 ms    25 runs

Benchmark 8: profetch
  Time (mean ± σ):       3.9 ms ±   0.6 ms    [User: 1.6 ms, System: 1.8 ms]
  Range (min  max):     1.8 ms    5.7 ms    732 runs

Benchmark 9: yafetch
  Time (mean ± σ):     164.6 ms ±  29.5 ms    [User: 62.9 ms, System: 28.6 ms]
  Range (min  max):   130.1 ms  239.8 ms    20 runs

Summary
  nx-fetch ran
    1.03 ± 0.20 times faster than profetch
    1.24 ± 0.19 times faster than bunnyfetch
    1.57 ± 0.22 times faster than afetch
   12.54 ± 1.96 times faster than fastfetch
   37.26 ± 6.64 times faster than pfetch
   43.88 ± 9.37 times faster than yafetch
  145.28 ± 21.58 times faster than neofetch
  165.32 ± 19.36 times faster than inxi

#Further Examples

nx-fetch --no-logo

image of nx-fetch prompt without ascii/ansi logo

nx-fetch --raw uptime

12h1m40s

#License

This repository is GPL-3.0-or-later licensed.