Platform setup

Linux setup

Linux desktop widgets use the same embedded webview path as Desktop webview: createWidgetWindow without url (no widget.html copy). Extra Linux behavior is window pinning.

How it works

  1. setWidgetConfig writes IR into the desktop file store for (group, widgetId).
  2. createWidgetWindow opens a frameless Tauri webview on the widgetview protocol.
  3. With Cargo feature linux (default), the window is built hidden and pinned before its first map — GDK hints for _NET_WM_WINDOW_TYPE_DESKTOP, skip taskbar / pager, sticky and below — then shown, and its position is applied again after the map (window managers often ignore it for DESKTOP windows). The default layer on Linux is desktop; layer: "top" / "bottom" / "normal" use ABOVE / BELOW / an ordinary window instead (window modes).
  4. Optional feature layer-shell moves the webview into a gtk-layer-shell surface on Wayland: layer from layer (desktop → Background, bottom → Bottom, top → Top; normal stays a plain toplevel), output from the monitor at the window position, namespace = window label, anchors + margins from x / y (or from placement: right / bottom anchors keep their offset when the output resizes). clickThrough empties the input region; focusable: false turns off keyboard interactivity.
  5. Optional feature notify shows live activities as desktop notifications (activitySurface: "notification").

Setup

  1. Keep default features, or enable explicitly:
tauri-plugin-widgets = { version = "0.8", features = ["linux"] }
# Wayland:
# tauri-plugin-widgets = { version = "0.8", features = ["linux", "layer-shell"] }
  1. Allow the window label in capabilities (windows + widgets:default) — Install.
  2. Call createWidgetWindow as in First widget.

Contributor harness / debugging: Linux harness.

When it fails

  • Enable the linux feature for X11 DESKTOP pinning (default-features = false drops it).
  • Wayland: try layer-shell; plain X11 hints will not apply.
  • Window hidden behind everything and not clickable: that is layer: "desktop" on some window managers; use layer: "bottom".
  • See Linux harness for debugging pinned windows.

More symptoms: Troubleshooting index.