b34b0e2794722b68222893c3938746216f9ab718
fetchit
fetchit is a Linux terminal system information viewer written in C++. It's a single-file program (main.cpp) that prints a colored distro logo (when available) alongside system and hardware info, similar to neofetch/fastfetch.
Features
- Shows: distro, kernel, uptime, shell, CPU, GPU, RAM, and "OS Date".
- Distro detection via
/etc/os-release(PRETTY_NAMEfor display,IDfor logo matching). - Colored ASCII distro logos for supported distros.
- GPU detection by scanning PCI devices (
/sys/bus/pci/devices/) for class0x03*. - GPU name resolution via
/usr/share/hwdata/pci.ids(falls back to hex IDs if missing). - Accounts for Unicode character width for better alignment in terminals.
Supported Distro Logos
Logos are matched against /etc/os-release ID:
arch, cachyos, debian, ubuntu, fedora, manjaro, opensuse, pop, linuxmint, endeavouros, void, alpine
Requirements
- Linux
- A C++17-capable compiler (default:
g++) - UTF-8 locale + ANSI color support (recommended for icons/colors)
- Reads the following files/paths:
/etc/os-release/etc/hostname/proc/uptime/proc/cpuinfo/proc/meminfo/sys/bus/pci/devices//sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq/usr/share/hwdata/pci.ids(optional)
Build
Using the Makefile (recommended)
make
Binary output: build/fetchit
Run:
make run
Manual build
g++ -O2 -Wall -Wextra -std=c++17 -pipe -o fetchit main.cpp
Install / Uninstall
Install:
sudo make install
Defaults:
PREFIX=/usr/localBINDIR=$(PREFIX)/bin- Installs to:
/usr/local/bin/fetchit
Uninstall:
sudo make uninstall
Packaging-friendly variables:
DESTDIR(staging root)PREFIX,BINDIR
Example:
make install PREFIX=/usr BINDIR=/usr/bin DESTDIR=/tmp/pkgroot
Distribution Archive
Create a tar.gz containing the built binary:
make dist
Output: dist/fetchit-<version>-linux-x86_64-gnu.tar.gz
<version> is derived from:
git describe --tags --dirty --always (when available)
Full release pipeline:
make release
Notes
shellis taken from$SHELLand printed as the basename (e.g.bash, not/usr/bin/bash).OS Dateis computed from/etc/hostnamefile metadata (ctime) as an elapsed duration; it may not equal the OS install date.- If
pci.idsis unavailable, GPU(s) are printed as hex IDs like0xVVVV:0xDDDD. - If no distro logo matches, the logo section will be empty and only info lines are shown.
Sample Output
--- user@host ---
/\ distro: Arch Linux
/ \ kernel: 7.0.10-arch1-1
/ \ uptime: 12 minutes
/ \ shell: bash
/ ,, \ CPU: ... (N) @ X.XX GHz
/ | | \ GPU: ...
/_-'' ''-_\ RAM: 15.25 GB
OS Date: 6 months 17 days 3 hours 40 minutes
Languages
C++
97.3%
Makefile
2.7%