Positioner
Position your windows at well-known locations.
This plugin is a port of electron-positioner for Tauri.
Supported Platforms
This plugin requires a Rust version of at least 1.77.2
Platform | Level | Notes |
---|---|---|
windows | ||
linux | ||
macos | ||
android | | |
ios | |
Setup
Install the positioner plugin to get started.
Use your project’s package manager to add the dependency:
-
Run the following command in the
src-tauri
folder to add the plugin to the project’s dependencies inCargo.toml
: -
Modify
lib.rs
to initialize the plugin: -
Install the JavaScript Guest bindings using your preferred JavaScript package manager:
Additional setup is required to get tray-relative positions to work.
-
Add
tray-icon
feature to yourCargo.toml
file: -
Setup
on_tray_event
for positioner plugin:
Usage
The plugin’s APIs are available through the JavaScript guest bindings:
You can import and use the Window trait extension directly through Rust:
Permissions
By default all potentially dangerous plugin commands and scopes are blocked and cannot be accessed. You must modify the permissions in your capabilities
configuration to enable these.
See the Capabilities Overview for more information and the step by step guide to use plugin permissions.
Default Permission
Allows the moveWindow and handleIconState APIs
allow-move-window
set-tray-icon-state
Permission Table
Identifier | Description |
---|---|
|
Enables the move_window command without any pre-configured scope. |
|
Denies the move_window command without any pre-configured scope. |
|
Enables the set_tray_icon_state command without any pre-configured scope. |
|
Denies the set_tray_icon_state command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT