Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pevers/tauri-plugin-nosleep
Tauri plugin to block the power save functionality in the OS
https://github.com/pevers/tauri-plugin-nosleep
caffeine nosleep powersaving prevent-screen-lock tauri-plugin
Last synced: 16 days ago
JSON representation
Tauri plugin to block the power save functionality in the OS
- Host: GitHub
- URL: https://github.com/pevers/tauri-plugin-nosleep
- Owner: pevers
- License: mit
- Created: 2022-05-06T19:04:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-17T17:48:11.000Z (8 months ago)
- Last Synced: 2024-05-19T05:01:43.705Z (6 months ago)
- Topics: caffeine, nosleep, powersaving, prevent-screen-lock, tauri-plugin
- Language: Rust
- Homepage:
- Size: 1.67 MB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tauri - tauri-plugin-nosleep - Block the power save functionality in the OS. (Development / Plugins)
README
# tauri-plugin-nosleep
![Test](https://github.com/pevers/tauri-plugin-nosleep/workflows/Test/badge.svg)
Tauri plugin to block the power save functionality in the OS
```rust
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_nosleep::init())
.run(tauri::generate_context!())
.expect("failed to run app");
}
```Add the NPM package.
```console
npm install tauri-plugin-nosleep-api
# or
yarn add tauri-plugin-nosleep-api
```Use this within TS/JS.
```js
import { block, NoSleepType, unblock } from 'tauri-plugin-nosleep-api'
block(NoSleepType.PreventUserIdleDisplaySleep);
// To unblock whenever you are done
unblock();
```