No description
Find a file
Krzysztof Andrelczyk b6806d68fe guest-js fix
2024-08-30 18:47:15 +02:00
android fixed params 2024-08-07 00:12:20 +02:00
dist-js fixed params 2024-08-07 00:12:20 +02:00
guest-js guest-js fix 2024-08-30 18:47:15 +02:00
ios fix iOS 2024-08-29 16:00:37 +02:00
permissions fix iOS 2024-08-29 16:00:37 +02:00
src fix ios 2024-08-08 14:55:49 +02:00
.gitignore fix ios 2024-08-08 14:55:49 +02:00
build.rs fixed params 2024-08-07 00:12:20 +02:00
Cargo.lock v0.1.4 iOS fix 2024-08-30 18:44:55 +02:00
Cargo.toml v0.1.4 iOS fix 2024-08-30 18:44:55 +02:00
package-lock.json fixed params 2024-08-07 00:12:20 +02:00
package.json v0.1.4 iOS fix 2024-08-30 18:44:55 +02:00
README.md final readmy 2024-08-08 23:09:17 +02:00
rollup.config.js init 2024-07-27 18:25:54 +02:00
tsconfig.json init 2024-07-27 18:25:54 +02:00

Tauri Plugin keep-screen-on

Provides commands to disable automatic screen dimming in Android and iOS.

Install

If you are installing from npm and crate.io package registry, make sure the versions for both packages are the same, otherwise, the API may not match.

Install the Core plugin by adding the following to your Cargo.toml file:

src-tauri/Cargo.toml

[dependencies]
tauri-plugin-keep-screen-on = "0.1.2"

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add tauri-plugin-keep-screen-on-api
# or
npm add tauri-plugin-keep-screen-on-api
# or
yarn add tauri-plugin-keep-screen-on-api

Usage

First you need to register the core plugin with Tauri:

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_keep_screen_on::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import { keepScreenOn } from "tauri-plugin-keep-screen-on-api";

keepScreenOn(true);

Or in Leptos:

#[derive(Serialize)]
struct KeepScreenOnArgs {
    enable: bool,
}


invoke(
        "plugin:keep-screen-on|keep_screen_on",
        to_value(&KeepScreenOnArgs { enable: true })
        .expect("Failed to serialize KeepScreenOnArgs"),
      )
.await
.unwrap();


License

Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.

MIT or MIT/Apache 2.0 where applicable.