Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Phate6660/nixinfo

A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust.
https://github.com/Phate6660/nixinfo

information-retrieval lib linux rust

Last synced: 1 day ago
JSON representation

A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust.

Awesome Lists containing this project

README

        

## nixinfo
A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust.

I may often be behind on updating the release on crates.io.

So if you want the latest and greatest, add:

`nixinfo = { git = "https://github.com/Phate6660/nixinfo" }`

To your dependencies section in `Cargo.toml`.

Otherwise add: `nixinfo = "0.3.2"` instead.

## Currently supported

- CPU model and temperature by thermal zones (Celsius)
+ `nixinfo::cpu()` -> `Result`
+ `nixinfo::temp()` -> `Result>`
* The tuple contains the device name and the temperature in that order
- Device name
+ `nixinfo::device()` -> `Result`
- Distro name
+ `nixinfo::distro()` -> `Result`
- Environment (e.g. DE or WM)
+ `nixinfo::environment()` -> `Result`
- env variables
+ `nixinfo::env("VARIABLE")` -> `Option`
- GPU info (requires `lspci` and `grep` to be installed for now until I find a pure rust solution)
+ `nixinfo::gpu()` -> `Result`
- Hostname
+ `nixinfo::hostname()` -> `Result`
- Kernel
+ `nixinfo::kernel()` -> `Result`
- Total memory in MBs
+ `nixinfo::memory_total()` -> `Result`
- Free memory in MBs
+ `nixinfo::memory_free()` -> `Result`
- Available memory in MBs
+ `nixinfo::memory_available()` -> `Result`
- Used memory in MBs
+ `nixinfo::memory_used()` -> `Result`
- Music info
+ Features for this:
* `music_mpd` for music info from mpd
* `music_playerctl` for music info from an MPRIS supporting program via `playerctl`
* Enable neither of the features to get an N/A message
+ `nixinfo::music()` -> `String`
- Package counts (managers supported are apk, apt, dnf, dpkg, eopkg, pacman, pip, portage, rpm, and xbps)
+ `nixinfo::packages("manager")` -> `Result`
- Terminal being used (unless tmux is used, in which case N/A will be outputted because reasons)
+ `nixnfo::terminal()` -> `Result`
- Uptime of device
+ `nixinfo::uptime()` -> `Result`

## TODO
- Get all package counts in pure Rust
+ apk
+ apt/dpkg
* explicitely installed
* ~~total installed~~
+ dnf
+ eopkg
+ flatpak
+ pacman
* explicitly installed
* ~~total installed~~
+ pip
+ ~~portage~~
* ~~explicitly installed~~
* ~~total installed~~
* rpm
* xbps
- ~~Get GPU in pure Rust~~
- Restructure code
- Support *BSD