Start with a Tauri app boilerplate. You can use the following command to create one:
npm create tauri-app@latest- 
Add a tray bar icon to your Tauri app:
- Open the 
tauri.conf.jsonfile. - Locate the 
"tauri"property. - Inside it, add a 
"systemTray"object, as shown below: 
 - Open the 
 
   {
     "tauri": {
       "systemTray": {
         "iconPath": "icons/icon.png",
         "iconAsTemplate": true
       }
     }
   }
Ensure that you provide the correct path to your tray icon image file.
- Configure Tauri to not display any window:
- In the same 
tauri.conf.jsonfile, find the"build"property. - Inside it, locate the 
"windows"property and set it to an empty array, like this: 
 - In the same 
 
   {
     "build": {
       "windows": []
     }
   }
By following these steps, you will be able to create a tray-only Tauri app with the specified tray bar icon and without any visible windows. Feel free to adjust the configuration based on your specific requirements.
Remember to run the necessary commands and build the app according to the Tauri documentation after making these changes.
    
Top comments (0)