nosleep

Crates.ionosleep
lib.rsnosleep
version0.2.1
sourcesrc
created_at2022-04-21 19:54:12.227692
updated_at2022-11-20 17:01:53.107397
descriptionBlock power save mode cross platform
homepagehttps://github.com/pevers/nosleep
repositoryhttps://github.com/pevers/nosleep
max_upload_size
id571854
size4,714
Peter Evers (pevers)

documentation

README

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
Commit count: 25

cargo fmt