How spectrumdev-tech/archfetch works
Archfetch is a small C11 system-information fetcher. A user runs the program; src/main.c loads display settings, gathers system and session details, then formats the values with Arch ASCII art and ANSI colors for terminal output. The sampled code confirms most collectors and their inputs; kernel and configuration behavior is included from the README, tree, and calls in main.c, while unsampled implementation details are not inferred.
Main entry points: main.c Fetch and render · osinfo.c OS identity · cpu.c CPU details · config.c Display settings
Components 18
Collection and display
- Fetch and render
src/main.c
System details
- OS identity
src/osinfo.c - Kernel version
src/kernel.c - CPU details
src/cpu.c - Text utilities
src/utils.c
Session and settings
- Shell details
src/shell.c - Desktop session
src/wm.c - Display settings
src/config.c
Runtime and packages
- Memory usage
src/memory.c - System uptime
src/uptime.c - Package count
src/packages.c
Other components
- User
- Terminal
- OS release file
- Kernel release file
- Proc system files
- Pacman local database
- Environment variables
Connections 23
- User → Fetch and render: runs
- Fetch and render → Display settings: loads settings
- Display settings → Fetch and render: returns settings
- Fetch and render → Display settings: gets color
- Fetch and render → OS identity: gets OS name
- Fetch and render → Kernel version: gets version
- Fetch and render → CPU details: gets CPU
- Fetch and render → Memory usage: gets memory
- Fetch and render → System uptime: gets uptime
- Fetch and render → Package count: counts packages
- Fetch and render → Shell details: gets shell
- Fetch and render → Desktop session: gets desktop
- Fetch and render → Terminal: prints report
- OS identity → OS release file: reads
- Kernel version → Kernel release file: reads
- CPU details → Proc system files: reads
- Memory usage → Proc system files: reads
- System uptime → Proc system files: reads
- Package count → Pacman local database: counts entries
- Shell details → Environment variables: reads
- Desktop session → Environment variables: reads
- OS identity → Text utilities: trims quotes
- CPU details → Text utilities: trims newline