|
1 |
| - |
2 |
| - |
3 |
| -Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux. |
4 |
| - |
5 |
| -## Install |
6 |
| - |
7 |
| -_This plugin requires a Rust version of at least **1.67**_ |
8 |
| - |
9 |
| -There are three general methods of installation that we can recommend. |
10 |
| - |
11 |
| -1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) |
12 |
| -2. Pull sources directly from Github using git tags / revision hashes (most secure) |
13 |
| -3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use) |
14 |
| - |
15 |
| -Install the Core plugin by adding the following to your `Cargo.toml` file: |
16 |
| - |
17 |
| -`src-tauri/Cargo.toml` |
18 |
| - |
19 |
| -```toml |
20 |
| -[dependencies] |
21 |
| -tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } |
22 |
| -``` |
23 |
| - |
24 |
| -You can install the JavaScript Guest bindings using your preferred JavaScript package manager: |
25 |
| - |
26 |
| -> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. |
27 |
| -
|
28 |
| -```sh |
29 |
| -pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v1 |
30 |
| -# or |
31 |
| -npm add https://github.com/tauri-apps/tauri-plugin-autostart#v1 |
32 |
| -# or |
33 |
| -yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v1 |
34 |
| -``` |
35 |
| - |
36 |
| -## Usage |
37 |
| - |
38 |
| -First you need to register the core plugin with Tauri: |
39 |
| - |
40 |
| -`src-tauri/src/main.rs` |
41 |
| - |
42 |
| -```rust |
43 |
| -use tauri_plugin_autostart::MacosLauncher; |
44 |
| - |
45 |
| -fn main() { |
46 |
| - tauri::Builder::default() |
47 |
| - .plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */)) |
48 |
| - .run(tauri::generate_context!()) |
49 |
| - .expect("error while running tauri application"); |
50 |
| -} |
51 |
| -``` |
52 |
| - |
53 |
| -Afterwards all the plugin's APIs are available through the JavaScript guest bindings: |
54 |
| - |
55 |
| -```javascript |
56 |
| -import { enable, isEnabled, disable } from "tauri-plugin-autostart-api"; |
57 |
| - |
58 |
| -await enable(); |
59 |
| - |
60 |
| -console.log(`registered for autostart? ${await isEnabled()}`); |
61 |
| - |
62 |
| -disable(); |
63 |
| -``` |
64 |
| - |
65 |
| -## Contributing |
66 |
| - |
67 |
| -PRs accepted. Please make sure to read the Contributing Guide before making a pull request. |
68 |
| - |
69 |
| -## Partners |
70 |
| - |
71 |
| -<table> |
72 |
| - <tbody> |
73 |
| - <tr> |
74 |
| - <td align="center" valign="middle"> |
75 |
| - <a href="https://crabnebula.dev" target="_blank"> |
76 |
| - <img src="https://github.com/tauri-apps/plugins-workspace/raw/v1/.github/sponsors/crabnebula.svg" alt="CrabNebula" width="283"> |
77 |
| - </a> |
78 |
| - </td> |
79 |
| - </tr> |
80 |
| - </tbody> |
81 |
| -</table> |
82 |
| - |
83 |
| -For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). |
84 |
| - |
85 |
| -## License |
86 |
| - |
87 |
| -Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. |
88 |
| - |
89 |
| -MIT or MIT/Apache 2.0 where applicable. |
| 1 | + |
| 2 | + |
| 3 | +Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux. |
| 4 | + |
| 5 | +## Install |
| 6 | + |
| 7 | +_This plugin requires a Rust version of at least **1.67**_ |
| 8 | + |
| 9 | +There are three general methods of installation that we can recommend. |
| 10 | + |
| 11 | +1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) |
| 12 | +2. Pull sources directly from Github using git tags / revision hashes (most secure) |
| 13 | +3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use) |
| 14 | + |
| 15 | +Install the Core plugin by adding the following to your `Cargo.toml` file: |
| 16 | + |
| 17 | +`src-tauri/Cargo.toml` |
| 18 | + |
| 19 | +```toml |
| 20 | +[dependencies] |
| 21 | +tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } |
| 22 | +``` |
| 23 | + |
| 24 | +You can install the JavaScript Guest bindings using your preferred JavaScript package manager: |
| 25 | + |
| 26 | +> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. |
| 27 | +
|
| 28 | +```sh |
| 29 | +pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v1 |
| 30 | +# or |
| 31 | +npm add https://github.com/tauri-apps/tauri-plugin-autostart#v1 |
| 32 | +# or |
| 33 | +yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v1 |
| 34 | +``` |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +First you need to register the core plugin with Tauri: |
| 39 | + |
| 40 | +`src-tauri/src/main.rs` |
| 41 | + |
| 42 | +```rust |
| 43 | +use tauri_plugin_autostart::MacosLauncher; |
| 44 | + |
| 45 | +fn main() { |
| 46 | + tauri::Builder::default() |
| 47 | + .plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */)) |
| 48 | + .run(tauri::generate_context!()) |
| 49 | + .expect("error while running tauri application"); |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +Afterwards all the plugin's APIs are available through the JavaScript guest bindings: |
| 54 | + |
| 55 | +```javascript |
| 56 | +import { enable, isEnabled, disable } from "tauri-plugin-autostart-api"; |
| 57 | + |
| 58 | +await enable(); |
| 59 | + |
| 60 | +console.log(`registered for autostart? ${await isEnabled()}`); |
| 61 | + |
| 62 | +disable(); |
| 63 | +``` |
| 64 | + |
| 65 | +## Contributing |
| 66 | + |
| 67 | +PRs accepted. Please make sure to read the Contributing Guide before making a pull request. |
| 68 | + |
| 69 | +## Partners |
| 70 | + |
| 71 | +<table> |
| 72 | + <tbody> |
| 73 | + <tr> |
| 74 | + <td align="center" valign="middle"> |
| 75 | + <a href="https://crabnebula.dev" target="_blank"> |
| 76 | + <img src="https://github.com/tauri-apps/plugins-workspace/raw/v1/.github/sponsors/crabnebula.svg" alt="CrabNebula" width="283"> |
| 77 | + </a> |
| 78 | + </td> |
| 79 | + </tr> |
| 80 | + </tbody> |
| 81 | +</table> |
| 82 | + |
| 83 | +For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). |
| 84 | + |
| 85 | +## License |
| 86 | + |
| 87 | +Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. |
| 88 | + |
| 89 | +MIT or MIT/Apache 2.0 where applicable. |
0 commit comments