Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pevers/nosleep

Cross-platform library to block the power save function in the OS
https://github.com/pevers/nosleep

caffeine nosleep powersave powersaving prevent-lock prevent-screen-lock

Last synced: about 2 months ago
JSON representation

Cross-platform library to block the power save function in the OS

Awesome Lists containing this project

README

        

# nosleep

[![Continuous Integration (macOS)](https://github.com/pevers/nosleep/actions/workflows/mac.yml/badge.svg)](https://github.com/pevers/nosleep/actions/workflows/mac.yml) [![Continuous Integration (Linux)](https://github.com/pevers/nosleep/actions/workflows/linux.yaml/badge.svg)](https://github.com/pevers/nosleep/actions/workflows/linux.yaml) [![Continuous Integration (Windows)](https://github.com/pevers/nosleep/actions/workflows/windows.yaml/badge.svg)](https://github.com/pevers/nosleep/actions/workflows/windows.yaml) [![license](https://img.shields.io/crates/l/nosleep?style=flat-square)](https://crates.io/crates/nosleep/) [![version](https://img.shields.io/crates/v/nosleep?style=flat-square)](https://crates.io/crates/nosleep/) ![Crates.io](https://img.shields.io/crates/d/nosleep?style=flat-square)

Cross-platform library to block the power save function in the OS.

```rust
use nosleep::{NoSleep, NoSleepTrait};
let mut nosleep = NoSleep::new().unwrap();
nosleep
.prevent_display_sleep() // or prevent_system_sleep()
.unwrap();
std::thread::sleep(std::time::Duration::from_millis(180_000));
nosleep.stop().unwrap(); // Not strictly needed
```

## Supported Platforms

| Platform | Status | Tested |
|----------|--------|--------|
| Linux | ✔️ | ✔️ |
| macOS | ✔️ | ✔️ |
| Windows | ✔️ | ✔️ |
| iOS | ❌ | ❌ |
| Android | ❌ | ❌ |