tauri-plugin-nosleep

Crates.iotauri-plugin-nosleep
lib.rstauri-plugin-nosleep
version2.0.0-beta.1
sourcesrc
created_at2022-05-08 13:10:22.304528
updated_at2024-02-25 18:40:50.980689
descriptionTauri plugin to prevent the power save functionality in the OS
homepage
repository
max_upload_size
id582483
size24,028
Peter Evers (pevers)

documentation

README

tauri-plugin-nosleep

Test dependency status

Tauri plugin to block the power save functionality in the OS

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

Add the NPM package.

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

Use this within TS/JS.

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

cargo fmt