5 releases
0.2.1 | Nov 20, 2022 |
---|---|
0.2.0 | May 8, 2022 |
0.2.0-rc.2 | May 7, 2022 |
0.2.0-rc.1 | May 4, 2022 |
#1 in #nosleep
574 downloads per month
Used in 5 crates
(4 directly)
3KB
nosleep
Cross-platform library to block the power save function in the OS.
use nosleep::{NoSleep, NoSleepType};
let mut nosleep = NoSleep::new().unwrap();
nosleep
.start(NoSleepType::PreventUserIdleDisplaySleep)
.unwrap();
std::thread::sleep(std::time::Duration::from_millis(180_000));
nosleep.stop().unwrap(); // Not strictly needed
Dependencies
~1.5MB
~37K SLoC