Only for MacOS
Cargo.toml
[dependencies]
tauri-plugin-nspopover = { git = "https://github.com/freethinkel/tauri-nspopover-plugin.git" }
main.rs
use tauri::{ActivationPolicy, Manager};
#[cfg(target_os = "macos")]
use tauri_plugin_nspopover::WindowExt;
fn main() {
tauri::Builder::default()
.setup(|app| {
app.set_activation_policy(ActivationPolicy::Accessory);
let window = app.app_handle().get_window("main").unwrap();
#[cfg(target_os = "macos")]
window.to_popover();
Ok(())
})
.system_tray(tray)
.plugin(tauri_plugin_nspopover::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
tauri.config.json
"systemTray": {
"iconPath": "icons/statusbar-icon.png",
"iconAsTemplate": true
},
...
"windows": [
{
"fullscreen": false,
"resizable": true,
"title": "inboxion",
"width": 300,
"height": 450,
"visible": false,
"transparent": true
}
]
git clone https://github.com/freethinkel/tauri-nspopover-plugin
cd tauri-nspopover-plugin/example
npm install
npm run tauri dev