https://github.com/mgmerino/cpu-ruststats
A set of Rust tools for monitoring CPU usage and system temperatures
https://github.com/mgmerino/cpu-ruststats
cpu-monitoring i3blocks rust
Last synced: 6 months ago
JSON representation
A set of Rust tools for monitoring CPU usage and system temperatures
- Host: GitHub
- URL: https://github.com/mgmerino/cpu-ruststats
- Owner: mgmerino
- License: mit
- Created: 2025-06-13T19:17:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-16T20:34:04.000Z (about 1 year ago)
- Last Synced: 2025-06-27T12:43:32.483Z (about 1 year ago)
- Topics: cpu-monitoring, i3blocks, rust
- Language: Rust
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚀 CPU Stats Monitor

A couple of Rust binaries for monitoring CPU usage and system temperatures, designed to be used with i3blocks/i3status.
Disclaimer: this has been vibe coded. I have zero experience with Rust, don't be surprised by outrageous constructions and ideas.
## ✨ Features
- **CPU Monitor**: Displays real-time CPU usage with an ASCII sparkline 📊
- **Temperature Monitor**: Shows the average temperature of system sensors with an ASCII sparkline 🌡️
- Support for warning and critical thresholds ⚠️
- Data history stored in `/tmp` 📁
- Integration with i3blocks/i3status 🔄
## 🛠️ Requirements
- Rust (latest stable version)
- `sensors` (for temperature monitoring)
- i3blocks or i3status (optional)
## 📦 Installation
1. Clone the repository:
```bash
git clone https://github.com/mgmerino/cpu-ruststats.git
cd cpu-ruststats
```
2. Build the project:
```bash
cargo build --release
```
## 🚀 Usage
### CPU Monitor
```bash
./target/release/cpu [options]
```
Options:
- `-w, --warning `: Warning threshold in percentage (default: 70.0) ⚠️
- `-c, --critical `: Critical threshold in percentage (default: 90.0) 🚨
- `-n, --count `: Sparkline length (default: 20) 📊
### Temperature Monitor
```bash
./target/release/temperature [options]
```
Options:
- `-w, --warning `: Warning threshold in degrees (default: 70.0) ⚠️
- `-c, --critical `: Critical threshold in degrees (default: 90.0) 🚨
- `--chip `: Specify the sensor chip 🔧
- `-n, --count `: Sparkline length (default: 5) 📊
## 🖥️ i3blocks Configuration
Example configuration for `~/.config/i3blocks/config`:
```ini
[cpu]
command=/path/to/cpu -n 20
interval=1
[temperature]
command=/path/to/temperature --chip coretemp-isa-0000 -n 10
interval=10
```
## 📄 License
This project is licensed under the MIT License - see the LICENSE file for details. 🎉