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

#369 in Operating systems

Download history 45/week @ 2024-01-05 19/week @ 2024-01-12 30/week @ 2024-01-19 25/week @ 2024-01-26 6/week @ 2024-02-02 15/week @ 2024-02-09 66/week @ 2024-02-16 80/week @ 2024-02-23 59/week @ 2024-03-01 112/week @ 2024-03-08 113/week @ 2024-03-15 52/week @ 2024-03-22 142/week @ 2024-03-29 70/week @ 2024-04-05 52/week @ 2024-04-12 48/week @ 2024-04-19

317 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–29MB
~391K SLoC