Crates.io | tauri-plugin-screen-lock-status |
lib.rs | tauri-plugin-screen-lock-status |
version | 0.1.2 |
source | src |
created_at | 2024-02-07 20:14:32.617704 |
updated_at | 2024-03-01 20:57:49.025331 |
description | This plugin helps track the lock status for the current session |
homepage | |
repository | https://github.com/ren40/tauri-plugin-screen-lock-status |
max_upload_size | |
id | 1130943 |
size | 27,149 |
Данный плагин помогает отслеживать статус блокировки для текущей сессии. Текущая версия плагина подходит для Tauri 1.5.4
.
src-tauri/Cargo.toml
добавить:[dependencies]
tauri-plugin-screen-lock-status = { git = "https://github.com/ren40/tauri-plugin-screen-lock-status" }
src-tauri/src/main.rc
подключаем://main.rc
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_screen_lock_status::init())
.setup(|app| {
let _ =
tauri_plugin_screen_lock_status::WINDOW_TAURI.set(app.get_window("main").unwrap());
Ok(())
})
}
import { listen } from '@tauri-apps/api/event'
await listen("window_screen_lock_status://change_session_status", (result) => {
console.log(`[${new Date().toLocaleString()} ${result.payload}]`)
})
window_screen_lock_status://change_session_status
.Название ОС | Статус |
---|---|
Windows | :white_check_mark: |
Linux | :white_check_mark: |
MacOS | :white_check_mark: |
Android | :negative_squared_cross_mark: |
IOS | :negative_squared_cross_mark: |
PR принимаются.
This plugin helps you control the lock status for the current session. The current version of the plugin is suitable for Tauri 1.5.4
.
src-tauri/Cargo.toml
:[dependencies]
tauri-plugin-screen-lock-status = { git = "https://github.com/ren40/tauri-plugin-screen-lock-status" }
src-tauri/src/main.rc
, we connect://main.rc
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_screen_lock_status::init())
.setup(|app| {
let _ =
tauri_plugin_screen_lock_status::WINDOW_TAURI.set(app.get_window("main").unwrap());
Ok(())
})
}
import { listen } from '@tauri-apps/api/event'
await listen("window_screen_lock_status://change_session_status", (result) => {
console.log(`[${new Date().toLocaleString()} ${result.payload}]`)
})
OS name | Status |
---|---|
Windows | :white_check_mark: |
Linux | :white_check_mark: |
MacOS | :white_check_mark: |
Android | :negative_squared_cross_mark: |
IOS | :negative_squared_cross_mark: |
PRs accepted.