#tauri-plugin #power #save #prevent #block #package

sys tauri-plugin-nosleep

Tauri plugin to prevent the power save functionality in the OS

2 releases (1 unstable)

2.0.0-beta.1 Feb 25, 2024
0.1.0 May 8, 2022

#320 in GUI

Download history 25/week @ 2023-12-17 43/week @ 2024-01-07 6/week @ 2024-01-14 15/week @ 2024-01-21 51/week @ 2024-02-18 136/week @ 2024-02-25 29/week @ 2024-03-03 110/week @ 2024-03-10 48/week @ 2024-03-17 31/week @ 2024-03-24 42/week @ 2024-03-31

234 downloads per month

MIT license

8KB
88 lines

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();

Dependencies

~17–66MB
~1M SLoC