Keep your system awake based on activity metrics (CPU, network, disk) and running processes.
- Rust 100%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| demo.gif | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
Midday Caffeine
Tired of broken SSH connections during important work? Your computer taking a nap while in the middle of compilations or downloads?
Midday Caffeine keeps your system awake based on activity metrics (CPU, network, disk) and running processes. If it detects significant activity or specific processes running, it prevents your system from going to sleep.
Features
- Monitors CPU, network, and disk activity.
- Keeps the system awake if activity exceeds user-defined thresholds.
- Allows specifying processes that should trigger caffeination.
- System tray icon that indicates whether the system is being kept awake.
- Optional desktop notifications when caffeination is activated.
Configuration
You can configure Midday Caffeine using a config.toml file. Below is an example configuration:
check_every_seconds = 5
cpu_threshold = 90.0
network_upload_threshold = 100_000_000
network_download_threshold = 100_000_000
show_notifications = false
disk_read_threshold = 150_000_000
disk_write_threshold = 150_000_000
caffeinate_if_running_process = ["ssh.exe"]
It will keep the system awake if:
- CPU usage exceeds 90%, or
- Network upload or download exceeds 100 MB/s, or
- Disk read or write exceeds 150 MB/s, or
- The process
ssh.exeis running by checking every 5 seconds.
The location depends on your operating system:
- Linux:
~/.config/midday-caffeine/config.toml - Windows:
%APPDATA%\midday-caffeine\config.toml - macOS:
~/Library/Application Support/midday-caffeine/config.toml
Known issues
- The system tray icon image is not updated on Linux when the caffeination state changes. This is a limitation of the
tray-iconcrate.
Building from source
On Linux, first install the dependencies listed in the tray-icon README. Then, build like any ordinary Rust project.
