GithubHelp home page GithubHelp logo

ren40 / tauri-plugin-screen-lock-status Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 223 KB

This plugin helps you control the lock status for the current session.

License: Apache License 2.0

Rust 100.00%
tauri tauri-plugin vue vue3 vuejs

tauri-plugin-screen-lock-status's Introduction

Плагин для отслеживания блокировки сессии |eng|

Данный плагин помогает отслеживать статус блокировки для текущей сессии. Текущая версия плагина подходит для Tauri 1.5.4.

Установка

  • [ 1 ] Для начала работы нужно подключить в проект плагин
  • [ 2 ] Для этого в src-tauri/Cargo.toml добавить:
[dependencies]
  tauri-plugin-screen-lock-status = { git = "https://github.com/ren40/tauri-plugin-screen-lock-status" }
  • [ 3 ] Далее в исполняемом файле 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(())
          })
}
  • [ 4 ] Для прослушивания надо подключить следующий код:
import { listen } from '@tauri-apps/api/event'

await listen("window_screen_lock_status://change_session_status", (result) => {
    console.log(`[${new Date().toLocaleString()} ${result.payload}]`)
  })
  • [ 4.1 ]Событие изменения статуса прослушиваются по каналу window_screen_lock_status://change_session_status.

ОС

Название ОС Статус
Windows
Linux
MacOS
Android
IOS

Цели

  • Реализовать и проверить для MacOS
  • Реализовать и проверить для Android
  • Реализовать и проверить для IOS
  • Проверить работоспособность для версии Tauri v2 и выше (При условии что он станет стабильным)

Сотрудничество

PR принимаются.


Plugin for tracking session blocking |rus|

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.

Installation

  • [ 1 ] To get started, you need to connect a plugin to the project
  • [ 2 ] To do this, add to src-tauri/Cargo.toml:
[dependencies]
  tauri-plugin-screen-lock-status = { git = "https://github.com/ren40/tauri-plugin-screen-lock-status" }
  • [ 3 ] Next, in the executable file 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(())
          })
}
  • [ 4 ] To listen, you need to connect the following code:
import { listen } from '@tauri-apps/api/event'

await listen("window_screen_lock_status://change_session_status", (result) => {
    console.log(`[${new Date().toLocaleString()} ${result.payload}]`)
  })
  • [ 4.1 ]The status change event is listened to via the channel `window_screen_lock_status://change_session_status'.

OS

OS name Status
Windows
Linux
MacOS
Android
IOS

TODO

  • Implement and test for MacOS
  • Implement and test for Android
  • Implement and test for iOS
  • Check performance for version Tauri v2 and higher (Assuming it becomes stable)

Contributing

PRs accepted.

tauri-plugin-screen-lock-status's People

Contributors

ren40 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.