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

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

Awesome Lists containing this project

README

          

# 🚀 CPU Stats Monitor
![Example of how this little binaries look like](example.png)

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. 🎉