Positioner
Position your windows at well-known locations.
This plugin is a port of electron-positioner for Tauri.
Supported Platforms
- Windows
- Linux
- macOS
Setup
This plugin requires a Rust version of at least 1.75
Install the positioner plugin to get started.
Use your project’s package manager to add the dependency:
-
Install the positioner plugin by adding the following to your
Cargo.toml
file: -
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 plugin commands are blocked and cannot be accessed.
You must define a list of permissions in your capabilities
configuration.
See Permissions Overview for more information.
Permission | Description |
---|---|
positioner:allow-move-window | Enables the move_window command without any pre-configured scope. |
positioner:deny-move-window | Denies the move_window command without any pre-configured scope. |
positioner:default | Allows the move_window command. |
© 2024 Tauri Contributors. CC-BY / MIT