Skip to content

Commit d3bb9fd

Browse files
Adding advice for using tray-icons with flatpak packaged apps (#3349)
1 parent 626ef59 commit d3bb9fd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/content/docs/distribute/flatpak.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ finish-args:
7575
- --socket=fallback-x11 # Permission needed to show the window
7676
- --device=dri # OpenGL, not necessary for all projects
7777
- --share=ipc
78+
- --talk-name=org.kde.StatusNotifierWatcher # Optional: needed only if your app uses the tray icon
79+
- --filesystem=xdg-run/tray-icon:create # Optional: needed only if your app uses the tray icon - see an alternative way below
7880

7981
modules:
8082
- name: binary
@@ -99,6 +101,19 @@ modules:
99101
100102
The Gnome 46 runtime includes all dependencies of the standard Tauri app with their correct versions.
101103
104+
:::note[Using tray-icon without changing the Flatpak manifest]
105+
If you prefer not opening access from your app to $XDG_RUNTIME_DIR (where tray-icon is saved on linux), you can change the path tauri saves the tray image:
106+
107+
```rust
108+
TrayIconBuilder::new()
109+
.icon(app.default_window_icon().unwrap().clone())
110+
.temp_dir_path(app.path().app_cache_dir().unwrap()) // will save to the cache folder ($XDG_CACHE_HOME) where the app already has permission
111+
.build()
112+
.unwrap();
113+
```
114+
115+
:::
116+
102117
**5. Install, and Test the app**
103118

104119
```shell

0 commit comments

Comments
 (0)