<h1 style="display: flex; justify-content: space-between;">
<span>
nxfetch
</span>
<span>
<a href="https://builds.sr.ht/~sntx/nxfetch?"><img src="https://builds.sr.ht/~sntx/nxfetch.svg" alt="nxfetch status"></a>
</span>
</h1>
A minimal, fast and batteries included fetcher!
> ```sh
> nxfetch
> ```
> 
## Installation
<details>
<summary>Cargo</summary>
```sh
cargo install --git https://git.sr.ht/~sntx/nxfetch --locked
```
</details>
<details>
<summary>Cargo (manual)</summary>
```sh
git clone https://git.sr.ht/~sntx/nxfetch && cd nxfetch
cargo install --path . --locked
```
</details>
<details>
<summary>Nix Shell</summary>
```sh
nix shell sourcehut:~sntx/nxfetch
```
</details>
## Usage
```txt
Usage: nxfetch [OPTIONS] [MODULES]...
Arguments:
[MODULES]... A list of module names nxfetch should display [possible values: title, user, host, os, kernel, uptime, shell, cpu, memory, colours, colours-bright, empty]
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
nxfetch 0.1.2 has been tested with [hyperfine](https://lib.rs/crates/hyperfine).
You can test nxfetch against other popular fetchers by running:
```sh
nix run .#benchmark
```
```sh
$ nix run .#benchmark
Benchmark 1: ./result/bin/nxfetch
Time (mean ± σ): 0.8 ms ± 0.1 ms [User: 0.3 ms, System: 0.4 ms]
Range (min … max): 0.7 ms … 1.5 ms 3831 runs
Benchmark 2: afetch
Time (mean ± σ): 1.7 ms ± 0.1 ms [User: 1.2 ms, System: 0.6 ms]
Range (min … max): 1.5 ms … 2.2 ms 1730 runs
Benchmark 3: bunnyfetch
Time (mean ± σ): 1.3 ms ± 0.1 ms [User: 0.5 ms, System: 1.0 ms]
Range (min … max): 1.2 ms … 1.9 ms 2279 runs
Benchmark 4: neofetch
Time (mean ± σ): 240.8 ms ± 2.4 ms [User: 130.1 ms, System: 80.6 ms]
Range (min … max): 236.7 ms … 246.0 ms 12 runs
Benchmark 5: pfetch
Time (mean ± σ): 63.5 ms ± 1.4 ms [User: 29.7 ms, System: 15.3 ms]
Range (min … max): 61.6 ms … 68.8 ms 46 runs
Benchmark 6: profetch
Time (mean ± σ): 1.2 ms ± 0.1 ms [User: 0.6 ms, System: 0.5 ms]
Range (min … max): 1.1 ms … 1.9 ms 2574 runs
Benchmark 7: yafetch
Time (mean ± σ): 67.2 ms ± 1.0 ms [User: 27.1 ms, System: 12.5 ms]
Range (min … max): 66.2 ms … 72.7 ms 45 runs
Benchmark 8: inxi
Time (mean ± σ): 469.2 ms ± 1.3 ms [User: 70.2 ms, System: 47.2 ms]
Range (min … max): 467.4 ms … 471.8 ms 10 runs
Summary
'./result/bin/nxfetch' ran
1.54 ± 0.25 times faster than 'profetch'
1.69 ± 0.24 times faster than 'bunnyfetch'
2.17 ± 0.30 times faster than 'afetch'
79.85 ± 10.01 times faster than 'pfetch'
84.49 ± 10.50 times faster than 'yafetch'
302.56 ± 37.44 times faster than 'neofetch'
589.60 ± 72.74 times faster than 'inxi'
```
## Further Examples
> ```sh
> nxfetch --no-logo
> ```
> 
> ```sh
> nxfetch --raw uptime
> ```
> `12h1m40s`
## License
This repository is GPL-3.0-or-later licensed.