Skip to content

Plugins

miracle-wm's plugin system lets you extend and override core compositor behavior through sandboxed WebAssembly modules. Because plugins run in a WebAssembly sandbox, a misbehaving plugin cannot crash or corrupt the compositor.

Writing a Plugin

Plugins are written in Rust using the miracle-plugin crate. The crate provides macros and types for hooking into compositor lifecycle events. Other languages may be supported in the future in addition to Rust.

Full API documentation is available at docs.miracle-wm.org/miracle_plugin/.

Examples

  • miri — the Miri plugin that turns Miracle into a scrolling window manager
  • focus-blur-plugin — a plugin that blurs unfocused windows
  • night-light-plugin — a plugin that applies an orange tint to your screen as the day progresses
  • mattkae/dotfiles — a real-world plugin used in the author's personal setup

Loading Plugins

To load your plugin, you can either specify them in your configuration (see plugins).

Alternatively, you can place the .wasm file directly into $XDG_CONFIG_HOME/miracle-wm/config/plugins and they will be loaded directly.