#tauri-plugin #tauri #nosleep #prevent-user-idle-d #splay-sleep

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

#512 in Operating systems

Download history 43/week @ 2024-12-12 3/week @ 2024-12-19 1/week @ 2025-02-13 2/week @ 2025-02-20 8/week @ 2025-02-27 22/week @ 2025-03-06 21/week @ 2025-03-13 3/week @ 2025-03-20 6/week @ 2025-03-27

54 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–55MB
~871K SLoC