retch-sysinfo
A fast, concurrent, cross-platform hardware and system information gathering library for retch.
Extracted from the retch-cli binary to allow reuse as a standalone, zero-unnecessary-subprocess system probing library on Linux, macOS, and Windows.
Features
- High-Performance & Concurrent: Probes run in parallel using scoped threads for minimal latency.
- Zero Subprocess Overhead: Native Win32 FFI / WinRT COM on Windows, direct binary D-Bus socket connections on Linux, and Objective-C runtime FFI on macOS to avoid slow shell/interpreter forks.
- Comprehensive Hardware & OS Detection:
- CPU: Model name, physical/logical core count, P/E hybrid topology, frequency ranges, and cache sizes (L1/L2/L3).
- GPU & VRAM: AMD GPUs (via
libdrmamdgpu.ids& PCI IDs), NVIDIA, Intel, Apple Silicon, and Direct3D/WMI. - Displays: Multi-monitor resolution, refresh rates, and model/vendor names parsed from raw EDID binaries.
- Memory & Storage: RAM capacity/usage, swap, physical DIMM speeds/types (SMBIOS/dmidecode), physical disks, NVMe/SATA/HDD identification, Btrfs subvolumes, and ZFS pools.
- Network & Wi-Fi: Active default-route interface, local IPs, DNS domain/search scopes, Wi-Fi SSID/BSSID/channel/band/rate.
- Peripherals: Audio servers/devices, Bluetooth controller status & connected devices, Battery health/cycle counts, Power adapters, Webcams/cameras, Gamepads/controllers, Input devices (Keyboards, Mice, Touchpads), and TPM versions.
- Media & Player: Active media player name, playback status, and track metadata (artist, title, album).
- Desktop Environment: DE, Window Manager, Login Manager, UI Theme, Icons, Cursor, Terminal, Shell, and Weather.
Usage
Add retch-sysinfo to your Cargo.toml:
[]
= "0.1"
Basic Example
use ;
Modules
retch-sysinfo provides modular subsystem detectors:
| Module | Description |
|---|---|
audio |
Audio server (PipeWire, PulseAudio, ALSA, CoreAudio, WASAPI) and output devices |
battery |
Battery status, charge level, health, time remaining, and power supplies |
bios |
BIOS/firmware vendor, version, and release date |
bluetooth |
Bluetooth adapter power state, name, and connected devices |
btrfs |
Btrfs filesystem pools, allocation, and snapshot counts |
camera |
Connected webcams and video capture devices |
disk |
Filesystem mount usage and physical drive models (SSD/NVMe/HDD) |
display |
Display connector resolution, refresh rate, and EDID model parsing |
fetch |
Core orchestrator (SystemInfo, CollectOptions) |
gamepad |
Connected gamepads, joysticks, and controllers |
gpu |
GPU model detection and VRAM reporting |
input |
Input devices (keyboards, mice, touchpads, graphics tablets) |
media |
Active media player and playback track metadata |
memory |
RAM usage, swap, and physical memory DIMM details |
motherboard |
Motherboard / system vendor and model name |
network |
Network interfaces, IP addresses, DNS domain, and Wi-Fi link status |
packages |
Installed package counts (dpkg, rpm, pacman, flatpak, brew, etc.) |
shell |
Current user shell and version |
terminal |
Terminal emulator detection, window size, and font configuration |
theme |
Desktop theme, icons, cursor, and system fonts |
weather |
Current weather conditions |
wm |
Window manager and desktop environment detection |
zfs |
ZFS storage pool health and capacity |
License
This project is licensed under the GPL-3.0-or-later license. See the top-level repository for details.