tauri-plugin-screen-wake-lock

Crates.iotauri-plugin-screen-wake-lock
lib.rstauri-plugin-screen-wake-lock
version0.1.0
created_at2025-12-22 13:35:07.645732+00
updated_at2025-12-22 13:35:07.645732+00
descriptionA Tauri plugin to keep the screen awake while enabled (desktop only).
homepage
repositoryhttps://github.com/cijiugechu/tauri-plugin-screen-wake-lock
max_upload_size
id1999735
size152,977
Cistus Creticus (cijiugechu)

documentation

README

Tauri Plugin screen-wake-lock

Keep the display awake while enabled (desktop only).

Usage

Register the plugin:

tauri::Builder::default()
  .plugin(tauri_plugin_screen_wake_lock::init())
  .run(tauri::generate_context!())?;

Use from JavaScript:

import { isSupported, setEnabled } from 'tauri-plugin-screen-wake-lock-api'

if (await isSupported()) {
  await setEnabled(true, { reason: 'Playing video' })
}

Disable when no longer needed:

import { disable } from 'tauri-plugin-screen-wake-lock-api'

await disable()

Linux-specific options (optional):

await setEnabled(true, {
  reason: 'Navigation active',
  linuxOptions: {
    applicationId: 'com.example.app',
    reason: 'Navigation active'
  }
})
Commit count: 0

cargo fmt