GithubHelp home page GithubHelp logo

pevers / tauri-plugin-nosleep Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 3.0 1.71 MB

Tauri plugin to block the power save functionality in the OS

License: MIT License

Rust 55.90% TypeScript 25.84% JavaScript 18.26%
caffeine nosleep tauri-plugin powersaving prevent-screen-lock

tauri-plugin-nosleep's Introduction

tauri-plugin-nosleep

Test

Tauri plugin to block the power save functionality in the OS

fn main() {
  tauri::Builder::default()
    .plugin(tauri_plugin_nosleep::init())
    .run(tauri::generate_context!())
    .expect("failed to run app");
}

Add the NPM package.

npm install tauri-plugin-nosleep-api
# or
yarn add tauri-plugin-nosleep-api

Use this within TS/JS.

import { block, NoSleepType, unblock } from 'tauri-plugin-nosleep-api'
block(NoSleepType.PreventUserIdleDisplaySleep);
// To unblock whenever you are done
unblock();

tauri-plugin-nosleep's People

Contributors

pevers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tauri-plugin-nosleep's Issues

RUSTSEC-2022-0048: xml-rs is Unmaintained

xml-rs is Unmaintained

Details
Status unmaintained
Package xml-rs
Version 0.8.4
URL https://github.com/netvl/xml-rs/issues
Date 2022-01-26

xml-rs is a XML parser has open issues around parsing including integer
overflows / panics that may or may not be an issue with untrusted data.

Together with these open issues with Unmaintained status xml-rs
may or may not be suited to parse untrusted data.

Alternatives

See advisory page for additional details.

Bump to 0.2.1 of nosleep

Can you update this plugin to use the latest version of your parent nosleep package?

Great work with this, super useful ๐Ÿ˜ƒ

Tauri 2.0

Hi, would it be possible to update this plugin the support higher versions of Tauri? :)

error: failed to select a version for `webkit2gtk-sys`.
    ... required by package `wry v0.15.0`
    ... which satisfies dependency `wry = "^0.15"` of package `tauri-runtime-wry v0.4.0`
    ... which satisfies dependency `tauri-runtime-wry = "^0.4.0"` of package `tauri v1.0.0-rc.8`
    ... which satisfies dependency `tauri = "^1.0.0-rc.8"` of package `tauri-plugin-nosleep v0.1.0`
    ... which satisfies dependency `tauri-plugin-nosleep = "^0.1.0"` of package `museeks v0.20.0 (/Users/martpie/dev/museeks/src-tauri)`
versions that meet the requirements `^0.17` are: 0.17.0

the package `webkit2gtk-sys` links to the native library `web_kit2`, but it conflicts with a previous package which links to `web_kit2` as well:
package `webkit2gtk-sys v2.0.1`
    ... which satisfies dependency `ffi = "^2.0.1"` of package `webkit2gtk v2.0.1`
    ... which satisfies dependency `webkit2gtk = "=2.0.1"` of package `tauri v2.0.0-beta.6`
    ... which satisfies dependency `tauri = "^2.0.0-beta.5"` of package `museeks v0.20.0 (/Users/martpie/dev/museeks/src-tauri)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "web_kit2"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `webkit2gtk-sys` which could resolve this conflict
error Command failed with exit code 101.

Error when running with Tauri V2

When try to running locally with Xcode simulator get error error[E0432]: unresolved import 'nosleep::NoSleep' . Install tauri-plugin-nosleep with git link branch v2.

Tauri Info from the project

[โœ”] Environment
    - OS: Mac OS 14.2.1 X64
    โœ” Xcode Command Line Tools: installed
    โœ” rustc: 1.76.0 (07dca489a 2024-02-04)
    โœ” cargo: 1.76.0 (c84b36747 2024-01-18)
    โœ” rustup: 1.26.0 (5af9b9484 2023-04-05)
    โœ” Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.18.0
    - pnpm: 8.15.4
    - yarn: 1.22.19
    - npm: 9.8.1

[-] Packages
    - tauri [RUST]: 2.0.0-beta.8
    - tauri-build [RUST]: 2.0.0-beta.6
    - wry [RUST]: 0.37.0
    - tao [RUST]: 0.26.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.3
    - @tauri-apps/cli [NPM]: 2.0.0-beta.6

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../../dist/apps/clientapp
    - devUrl: http://localhost:4200/
    - framework: SolidJS
    - bundler: Vite

[-] iOS
    - Developer Teams: 

RUSTSEC-2021-0139: ansi_term is Unmaintained

ansi_term is Unmaintained

Details
Status unmaintained
Package ansi_term
Version 0.12.1
URL ogham/rust-ansi-term#72
Date 2021-08-18

The maintainer has adviced this crate is deprecated and will not
receive any maintenance.

The crate does not seem to have much dependencies and may or may not be ok to use as-is.

Last release seems to have been three years ago.

Possible Alternative(s)

The below list has not been vetted in any way and may or may not contain alternatives;

See advisory page for additional details.

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.