I am trying to center a Tauri app on the osx tray icon, but cannot find a way to do it.
The idea is to make the app open and close on tray icon click, and to make it fixed at the top of the screen and centered on the icon (the y position may change depending on the number of items available from other apps). Something like this:
https://eshop.macsales.com/blog/wp-content/uploads/2019/05/Fantastical1280.jpg
(Sorry, i tried to add the image to the question, but always got a "Server error" when uploading)
I have searched the docs, but haven't found anything and also didn't find a solution on google
On the
tauri.conf.json
there is awindows.x
andwindows.y
options, but i don't think i can get this kind of logic there.I noticed that there is a
window.set_position()
function that i could call when the icon is clicked. But i am not sure how to get the correct position to enter the window on the icon