6 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
0.1.0 Apr 21, 2022

#3 in #caffeine

Download history 82/week @ 2024-07-23 56/week @ 2024-07-30 26/week @ 2024-08-06 47/week @ 2024-08-13 92/week @ 2024-08-20 65/week @ 2024-08-27 90/week @ 2024-09-03 70/week @ 2024-09-10 46/week @ 2024-09-17 139/week @ 2024-09-24 102/week @ 2024-10-01 101/week @ 2024-10-08 74/week @ 2024-10-15 94/week @ 2024-10-22 120/week @ 2024-10-29 89/week @ 2024-11-05

401 downloads per month
Used in tauri-plugin-nosleep

MIT license

12KB
121 lines

nosleep

Continuous Integration (macOS) Continuous Integration (Linux) Continuous Integration (Windows) license version Crates.io

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–27MB
~373K SLoC