1 unstable release
| 0.1.0 | Dec 22, 2025 |
|---|
#1752 in GUI
40KB
237 lines
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'
}
})
Dependencies
~16–67MB
~1M SLoC