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

#4 in #caffeine

Download history 49/week @ 2024-11-13 61/week @ 2024-11-20 146/week @ 2024-11-27 67/week @ 2024-12-04 73/week @ 2024-12-11 25/week @ 2024-12-18 29/week @ 2025-01-01 22/week @ 2025-01-08 42/week @ 2025-01-15 13/week @ 2025-01-22 8/week @ 2025-01-29 37/week @ 2025-02-05 44/week @ 2025-02-12 23/week @ 2025-02-19 57/week @ 2025-02-26

163 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–26MB
~338K SLoC