#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

#937 in GUI

Download history 16/week @ 2024-07-25 2/week @ 2024-08-01 3/week @ 2024-08-15 10/week @ 2024-08-22 16/week @ 2024-08-29 6/week @ 2024-09-05 3/week @ 2024-09-12 24/week @ 2024-09-19 49/week @ 2024-09-26 81/week @ 2024-10-03 66/week @ 2024-10-10 32/week @ 2024-10-17 54/week @ 2024-10-24 50/week @ 2024-10-31 49/week @ 2024-11-07

200 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

~18–60MB
~1M SLoC