24 releases
0.3.3 | Mar 19, 2021 |
---|---|
0.3.2 | Dec 11, 2020 |
0.3.0 | Sep 3, 2020 |
0.2.9 | Sep 3, 2020 |
0.1.9 | Aug 16, 2020 |
#478 in Unix APIs
54 downloads per month
Used in 5 crates
20KB
417 lines
nixinfo
A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust.
To use: nixinfo = "0.2.8"
in your Cargo.toml
.
Currently supported
- CPU model and temperature (Celsius)
nixinfo::cpu()
->Result<String>
nixinfo::temp()
->Result<String>
- Device name
nixinfo::device()
->Result<String>
- Distro name
nixinfo::distro()
->Result<String>
- Environment (e.g. DE or WM)
nixinfo::environment()
->Result<String>
- env variables
nixinfo::env("VARIABLE")
->Option<String>
- GPU info (requires
lspci
andgrep
to be installed for now until I find a pure rust solution)nixinfo::gpu()
->Result<String>
- Hostname
nixinfo::hostname()
->Result<String>
- Kernel
nixinfo::kernel()
->Result<String>
- Total memory in MBs
nixinfo::memory()
->Result<String>
- Music info (only mpd is supported, requires
music
feature to be enabled)nixinfo::music()
->String
- Package counts (managers supported are apk, apt, dnf, dpkg, eopkg, pacman, pip, portage, rpm, and xbps)
nixinfo::packages("manager")
->Result<String>
- Terminal being used (unless tmux is used, in which case N/A will be outputted because reasons)
nixnfo::terminal()
->Result<String>
- Uptime of device
nixinfo::uptime()
->Result<String>
TODO
- Obtain used memory in addition to total memory
- Support *BSD
Dependencies
~43–510KB