| Crates.io | tauri-plugin-screen-wake-lock |
| lib.rs | tauri-plugin-screen-wake-lock |
| version | 0.1.0 |
| created_at | 2025-12-22 13:35:07.645732+00 |
| updated_at | 2025-12-22 13:35:07.645732+00 |
| description | A Tauri plugin to keep the screen awake while enabled (desktop only). |
| homepage | |
| repository | https://github.com/cijiugechu/tauri-plugin-screen-wake-lock |
| max_upload_size | |
| id | 1999735 |
| size | 152,977 |
Keep the display awake while enabled (desktop only).
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'
}
})