1
0
Fork
You've already forked exfetch
0
forked from Izder456/exfetch
shell extensible fetching program
  • Crystal 75.6%
  • Roff 13%
  • Makefile 5%
  • Nix 3.8%
  • HTML 2.6%
2025年12月08日 16:23:00 -06:00
assets new screenshots 2025年11月30日 18:42:52 -06:00
lib use submodule to ease packaging 2025年06月23日 16:42:51 -05:00
packaging extendible -> extensible 2025年07月02日 17:55:01 -05:00
src Fix get_uptime method on large uptime values 2025年12月08日 16:23:00 -06:00
.gitignore use submodule to ease packaging 2025年06月23日 16:42:51 -05:00
.gitmodules use submodule to ease packaging 2025年06月23日 16:42:51 -05:00
.woodpecker.yml I decided I don't want packages/releases 2025年12月01日 20:24:16 -06:00
CHANGELOG.org update changelog 2025年12月08日 14:41:30 -06:00
CONTRIBUTING.org revert the rebuild every time change 2025年12月05日 21:53:19 -06:00
flake.lock flake: add flake.nix support 2025年06月30日 01:45:14 -04:00
flake.nix flake: pull submodules automatically 2025年07月01日 01:07:15 -04:00
LICENSE add the LICENSE file too 2025年03月05日 08:55:46 -06:00
Makefile revert the rebuild every time change 2025年12月05日 21:53:19 -06:00
README.org remove width tag to make it not blurry 2025年11月30日 18:46:25 -06:00
shard.lock use submodule to ease packaging 2025年06月23日 16:42:51 -05:00
shard.yml 1.4.1 2025年10月12日 11:53:31 -05:00

Exfetch

a shell-extensible fetching utility aiming to be a spiritual successor to crfetch, written in crystal

https://ci.codeberg.org/api/badges/14871/status.svg https://img.shields.io/badge/license-ISC-blue.svg https://img.shields.io/badge/PRs-welcome-brightgreen.svg https://img.shields.io/badge/docs-contributing-purple.svg

Screenshot of Exfetch with default settings

(View screenshot)

Features

  • Predictable, consistent output across systems
  • Extensible via shell scripting and flags
  • No auto-detection "magic" - you control the output

Supported Operating Systems

  • Linux
  • FreeBSD
  • GhostBSD
  • OpenBSD
  • NetBSD

Motivation

Why Replicate Cr(y)fetch?

  • I wanted crfetch's simplicity with more customization:

    • Custom label ordering
    • Custom ASCII selection from file descriptors
    • Even more shell-script composability

Why the Name "Exfetch"?

  • "Ex" stands for extensible - modify behavior through flags/shell
  • (The accidental name stuck! Retroactively became "ex"-tended crfetch.)

Philosophy

  • Predictability: Same defaults everywhere. No assumptions about your OS/distro.
  • Composability: Pipe, script, or alias to create your ideal fetch.
  • No Auto-Detection: Unlike neofetch, ASCII art never changes unless you specify it.

Example: Shell Composability

Create dynamic configurations with shell features:

# Lowercase labels + purple text + cowsay fortune ASCII
alias exfetch="exfetch -l -c 5 -a <(cowsay $(fortune -o))"
# Random ASCII art from a directory
alias exfetch-random="exfetch -a \"$(ls ~/ascii_arts/* | shuf -n 1)\""

Note: <(command) requires Bash/Zsh. For other shells, use temporary files.

Custom Exfetch example

(View custom example)

Installation

Dependencies

Build from Source

$ git clone --recurse-submodules https://codeberg.org/izder456/exfetch
$ cd exfetch
$ make

OPTIONAL: you can set environment variables to change how it builds:

$ make STATIC=on # build with static compilation using crystal's --static (default is "off")
$ make MULTITHREADED=on # build with multithreading using crystal's -Dpreview_mt (default is "off")
$ make HARDENING=on # build with RELRO hardening (default is "off")
$ make STATIC=on MULTITHREADED=on # build with both multithreading *and* static compilation

Run without installing

$ make run

Install Binary

# make install

Usage

Usage: exfetch [options]
 -l, --lowercase Use lowercase labels
 -n, --nerd-icons Use Nerd Font icons
 -r, --right-justify Right justify labels
 -s SEP, --separator=SEP Separator between labels and values
 -o ORDER, --order=ORDER Specify label order (comma-separated)
 -O, --list-labels List available labels for ordering
 -c COLOR, --color=COLOR Text color name or code (0-15)
 -C, --list-colors List available colors
 -a ASCII, --ascii=ASCII ASCII art name or file path
 -A, --list-ascii List built-in ASCII art
 -P NAME, --preview-ascii=NAME Preview ASCII art
 -p PADDING, --padding=PADDING Padding around ASCII art (left and right) (only last digit used)
 -h, --help Show help

nix flake support

The flake.nix file in the project root provides support for the nix package manager.

Some things that can be done with this, assuming nix is installed and current directory is the root of the checked-out repo following the "Build from Source" section of this file:

  • nix build: build a nix packaging from the repo checkout
$ nix build
$ readlink ./result
$ tree ./result/
$ ./result/bin/exfetch
  • nix shell: enter a bash shell with the nix packaged built and "installed"(in $PATH)
$ nix shell
$$ exfetch
  • nix develop: enter a bash shell with the build environment available(build dependencies, nix packaging phases):
$ nix develop
$$ echo $unpackPhase $buildPhase $installPhase $checkPhase
$$ crystal ...
$$ shards ...

With only nix in hand, also possible to do any of these "remotely" without ever cloning the repo, by specifying git+https://codeberg.org/Izder456/exfetch?ref=main as the argument to those commands:

# fetch, build and execute exfetch using the nix interface
$ nix run 'git+https://codeberg.org/Izder456/exfetch?ref=main'
# enter a shell with `exfetch` executable available, built from source from current state of repo main branch
$ nix shell 'git+https://codeberg.org/Izder456/exfetch?ref=main'
# same but for some other git ref
$ nix shell 'git+https://codeberg.org/Izder456/exfetch?ref=some-branch'

(削除) Note that exfetch is also available in nixpkgs (削除ここまで) (not yet), but the package is maintained by someone else and built from semantic version bumps, while this flake provides a nix build for each commit (i.e. is not semantically versioned).

Contributing

License

ISC Licensed. See full text below:

ISC License
Copyright 2025 izzy Meyer <izder456@disroot.org>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Credits

  • ASCII art adapted from pfetch (MIT Licensed)
  • Inspiration from crfetch