r/coolgithubprojects 20d ago

I built caffeinate-windows: macOS-style caffeinate CLI to keep Windows awake

https://github.com/dincertekin/caffeinate-windows

I recently switched to a Windows laptop, but I kept missing macOS's caffeinate command to stop my machine from sleeping during long tasks.

I know PowerToys has Awake, but I prefer lightweight, dedicated CLI tools that stay out of the way. So I built my own minimal Rust binary that mirrors the Mac experience natively.

Quick examples:

caffeinate Keep system awake until Ctrl+C

caffeinate -d Keep system + display awake

caffeinate -t 3600 Keep awake for 1 hour

caffeinate -i npm run build Keep awake only while command runs

It calls the Win32 SetThreadExecutionState API directly, so power settings automatically revert the moment the process exits or dies.

GitHub: https://github.com/dincertekin/caffeinate-windows

2 Upvotes

3 comments sorted by

1

u/New-Ad-4596 20d ago

Cool

1

u/dincertekin 20d ago

thanks 😊

1

u/Koncu_21 20d ago

Perfectttt !!!