| Crates.io | screen-wake-lock |
| lib.rs | screen-wake-lock |
| version | 0.1.0 |
| created_at | 2025-12-18 16:45:36.601371+00 |
| updated_at | 2025-12-18 16:45:36.601371+00 |
| description | Cross-platform library to prevent display sleep/idle using wake locks |
| homepage | https://github.com/cijiugechu/screen-wake-lock |
| repository | https://github.com/cijiugechu/screen-wake-lock |
| max_upload_size | |
| id | 1992832 |
| size | 46,959 |
screen-wake-lockMinimal cross-platform screen wake lock library.
This library provides a simple guard that prevents the display from entering idle/sleep mode while it remains alive. It supports Windows, macOS, and Linux.
use screen_wake_lock::ScreenWakeLock;
// Acquire a wake lock
let lock = ScreenWakeLock::acquire("Playing video")?;
// Keep running...
// The screen will stay awake while the lock is alive
// Release the lock (also happens automatically when dropped)
drop(lock);
SetThreadExecutionState APIScreenWakeLock::is_supported()ScreenWakeLock::acquire_with_linux_options()cargo run --example keep_awake "Watching movie" 30