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

#1 in #caffeine

Download history 53/week @ 2023-12-06 35/week @ 2023-12-13 19/week @ 2023-12-20 7/week @ 2024-01-03 55/week @ 2024-01-10 19/week @ 2024-01-17 23/week @ 2024-01-24 22/week @ 2024-01-31 6/week @ 2024-02-07 65/week @ 2024-02-14 58/week @ 2024-02-21 77/week @ 2024-02-28 99/week @ 2024-03-06 124/week @ 2024-03-13 43/week @ 2024-03-20

355 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–31MB
~401K SLoC