Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pevers/tauri-plugin-nosleep

Tauri plugin to block the power save functionality in the OS
https://github.com/pevers/tauri-plugin-nosleep

caffeine nosleep powersaving prevent-screen-lock tauri-plugin

Last synced: about 2 months ago
JSON representation

Tauri plugin to block the power save functionality in the OS

Awesome Lists containing this project

README

        

# tauri-plugin-nosleep

![Test](https://github.com/pevers/tauri-plugin-nosleep/workflows/Test/badge.svg)

Tauri plugin to block the power save functionality in the OS

```rust
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_nosleep::init())
.run(tauri::generate_context!())
.expect("failed to run app");
}
```

Add the NPM package.

```console
npm install tauri-plugin-nosleep-api
# or
yarn add tauri-plugin-nosleep-api
```

Use this within TS/JS.

```js
import { block, NoSleepType, unblock } from 'tauri-plugin-nosleep-api'
block(NoSleepType.PreventUserIdleDisplaySleep);
// To unblock whenever you are done
unblock();
```