Skip to main content

retch_sysinfo/
lib.rs

1// SPDX-FileCopyrightText: 2026 Ken Tobias
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4//! # retch-sysinfo
5//!
6//! System information gathering library for retch.
7//!
8//! Provides cross-platform hardware and OS detection, GPU identification,
9//! battery status, and environment probing. Extracted from the `retch-cli`
10//! binary to allow reuse as a standalone library.
11//!
12//! ## Modules
13//!
14//! - [`audio`] — Audio server and device detection.
15//! - [`battery`] — Cross-platform battery status detection.
16//! - [`bios`] — BIOS / firmware version detection.
17//! - [`bluetooth`] — Bluetooth controller state and connected device detection.
18//! - [`camera`] — Camera and webcam detection.
19//! - [`display`] — Display detection and EDID parsing.
20//! - [`gamepad`] — Gamepad and joystick controller detection.
21//! - [`gpu`] — GPU detection and PCI ID lookup.
22//! - [`input`] — Keyboard and pointing-device detection.
23//! - [`io`] — Disk and network I/O throughput sampling.
24//! - [`disk`] — Physical disk model, size, and type detection.
25//! - [`media`] — Active media player and currently playing track detection.
26//! - [`memory`] — Physical memory (RAM) slot detection.
27//! - [`motherboard`] — Motherboard / system model detection.
28//! - [`network`] — Network interface detection, IP resolution, and Wi-Fi.
29//! - [`packages`] — Installed package count detection.
30//! - [`shell`] — Shell detection and version querying.
31//! - [`terminal`] — Terminal emulator detection and font configuration reading.
32//! - [`theme`] — UI theme, icon, cursor, and font detection.
33//! - [`weather`] — Weather information via wttr.in.
34//! - [`wm`] — Window manager detection.
35//! - [`fetch`] — Full system information gathering (`SystemInfo`, `CollectOptions`).
36
37pub mod audio;
38pub mod battery;
39pub mod bios;
40pub mod bluetooth;
41pub mod btrfs;
42pub mod camera;
43pub mod disk;
44pub mod display;
45pub mod fetch;
46pub mod gamepad;
47pub mod gpu;
48pub mod gpu_api;
49pub mod input;
50pub mod io;
51pub mod media;
52pub mod memory;
53pub mod motherboard;
54pub mod network;
55pub mod packages;
56pub mod shell;
57pub mod terminal;
58pub mod theme;
59pub mod weather;
60pub mod wm;
61pub mod zfs;
62
63// Gated on `test` as well as `windows` so the pure interface-classification rule (which
64// decides whether a `GetIfTable2` row is a real adapter or an NDIS filter instance) is
65// exercised by the Linux and macOS CI legs too — it is the load-bearing half, and it needs
66// no Windows API to test.
67#[cfg(any(target_os = "windows", test))]
68pub(crate) mod win_iftable;
69#[cfg(target_os = "windows")]
70pub(crate) mod win_reg;
71#[cfg(target_os = "windows")]
72pub(crate) mod win_setupapi;
73#[cfg(target_os = "windows")]
74pub(crate) mod win_users;
75
76#[cfg(target_os = "macos")]
77pub(crate) mod macos_ffi;
78
79pub use fetch::{CollectOptions, SystemInfo};