I am trying to build something like Raycast when I have a window that can be triggered open using an hotkey, while having an full screen app. I want a system tray daemon to run on startup, and then the app to open when I actually click on the application and the small portal to open when I press a certain keybind. How do I go about this?
#Creating multiple windows
5 messages · Page 1 of 1 (latest)
I want a system tray daemon to run on startup
https://github.com/tauri-apps/plugins-workspace/tree/dev/plugins/autostart
For minimum resource usage you wouldn't want to spawn any hidden windows but that leaves you with js-only. if you need js from the get-go you can spawn hidden windows (visible: false).
the app to open when I actually click on the application
system tray events (rust only) https://tauri.app/v1/guides/features/system-tray#listening-to-system-tray-events
the small portal to open when I press a certain keybind.
global_shortcut api (available in both rust and js) https://tauri.app/v1/api/js/globalShortcut (js) / https://github.com/tauri-apps/tauri/blob/b02fc90f450ff9e9d8a35ee55dc1beced4957869/examples/api/src-tauri/src/main.rs#L199-L209 (rust example)
If you don't spawn hidden windows in 1) you need to use the rust side.
thank you!
About the system tray events, I don't mean when clicked on the system tray. I really just meant when opening the app.
In the sense I can have Discord running in my system tray and I can still go and search for Discord which would open the app - if that makes sense.
If you want to restrict the app to one instance, you'll need this https://github.com/tauri-apps/plugins-workspace/tree/dev/plugins/single-instance - with this it should also be fairly easy to know when to open a new window from the main app that's running in the tray