Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.43 KB

write_new_widget.md

File metadata and controls

29 lines (18 loc) · 1.43 KB

🛠️ Implementing a new widget

What is a widget

A widget represents a piece of information displayed on the display.
It has a name and a corresponding value, that is updated dynamically.
Additionally, a widget consumes a configuration, that is entered by the user via the dashboard.

WebAssembly

Widgets are WebAssembly components, that implement the interface defined by the exports of the wg_display_widget_wit.
They are loaded by the WG Display application and run using the wasmtime WebAssembly runtime.

Using WebAssembly, as the basis for the widgets, has the following advantages:

  • Widgets are sandboxed and can't directly access the host system
  • Widgets can be written in any language that compiles to WebAssembly
  • Widgets can run on any platform that is supported by wasmtime

🚦 How to get started

For implementing a widget in Rust, there is a template repository that can be used to get started.
It contains the instructions on how to build and distribute the widget.

Template repositories for other languages will be added in the near future.

📦 Distribute the widget

See Add your widget to the store for more information.