Keep your system awake based on activity metrics (CPU, network, disk) and running processes.
Find a file
2026-04-12 13:24:51 +02:00
.forgejo/workflows Use -y when installing dependencies in CI 2025-11-19 22:23:40 +01:00
src Reduce tray icon image size 2025-11-15 22:28:54 +01:00
.gitattributes Initial commit 2025-11-11 10:11:53 +01:00
.gitignore Remove config.toml and add to .gitignore 2025-11-15 09:55:21 +01:00
Cargo.lock Merge pull request 'Update Rust crate toml to v0.9.12' (#5) from renovate/toml-0.x-lockfile into main 2026-04-12 13:24:51 +02:00
Cargo.toml Update Rust crate glib to 0.22.0 2026-04-11 20:50:50 +00:00
demo.gif Disk usage monitoring and improved docs 2025-11-15 09:35:16 +01:00
LICENSE Initial commit 2025-11-11 10:11:53 +01:00
README.md Update docs to include dependencies 2025-11-19 22:20:51 +01:00
renovate.json Add renovate.json 2025-11-15 19:16:46 +00:00

Midday Caffeine

Tired of broken SSH connections during important work? Your computer taking a nap while in the middle of compilations or downloads?

Demo GIF

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.exe is 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-icon crate.

Building from source

On Linux, first install the dependencies listed in the tray-icon README. Then, build like any ordinary Rust project.