Skip to content
  1. Docs
  2. enzimOS
  3. Developers

Shell and compositor integration

How the enzimOS shell, lock screen and pinned Hyprland compositor fit together, start up, and expose plugins, search providers and portals.

The desktop lives in the enzimos-shell repository. It contains the shell, Settings, the lock screen and greetd greeter, the privileged-client UI, the compositor patches and build, and the session configuration. They share one release contract and are released together. The animated wallpaper engine, enzwall, is a separate repository pinned as a submodule (see Wallpaper scene format).

Repository layout

PathContents
shell/The enzui-shell crate: shell, Settings, Quick Search, portals, polkit agent and helper binaries
lock/Lock screen and greeter
compositor/Scene-plugin sources for the pinned compositor (sidebar, overview, materials, remote outputs)
patches/Scoped patches over the pinned Hyprland and portal sources
config/Lua compositor policy, greetd/PAM files, portal routing and agent packaging
enzwall/Wallpaper engine submodule
examples/plugins/Sample shell plugins (cpu, clipboard, notifications, app-dock)
scripts/Build, preview, export and test entry points

Third-party sources are pinned through submodules and sources.lock.json. Setup must not silently advance them.

Building and previewing

sh
scripts/setup-sources
./enzui-hypr build
./enzui-hypr build-shell
./enzui-hypr build-apps
./enzui-hypr shell

Run this from an existing Wayland session. It starts an isolated nested desktop that does not touch the host's configuration. The build needs a recent Rust toolchain (the workspace Cargo.toml declares the minimum rust-version), a C++26 compiler, CMake, Meson, Ninja, Lua, systemd user services and the native libraries of the pinned components.

Builds go through scripts/with-build-budget, which limits them to one compiler job and a fixed memory budget. The default build root is .build/desktop; runtime state goes under $XDG_RUNTIME_DIR/enzui-desktop. ENZUI_HYPR_BUILDROOT, ENZUI_HYPR_RUNROOT, ENZUI_HYPR_CONFIG and ENZUI_HYPR_HOST_WAYLAND select private roots. Changing a pin needs a new build root; never replace a stack a running session uses.

sh
./enzui-hypr status
./enzui-hypr config-check
./enzui-hypr stop

For day-to-day iteration, build and test only the changed target:

sh
scripts/shell-iterate check settings
scripts/shell-iterate test settings system_pages::developer::tests
scripts/shell-iterate gate

scripts/preview-greeter-cu opens the login screen with mock accounts and simulated sign-in; nothing is installed.

The installed session

greetd selects /usr/share/wayland-sessions/enzui.desktop. Its session entry runs /usr/share/enzui/scripts/start-shell-platform --installed. The launcher refuses to start inside an existing Wayland desktop or without a logind session, and a per-account lock prevents a second login from merging with a running desktop.

Each login gets a fresh nonce and a delegated systemd user unit, enzui-platform-desktop-<nonce>.service. Startup runs in this order:

  1. Start the compositor with its ABI-matched scene plugin.
  2. Publish the Wayland display to D-Bus activation and the user manager, with XDG_CURRENT_DESKTOP=enzUI:Hyprland.
  3. Adopt the PAM-unlocked keyring when available and apply the input-method policy.
  4. Start the wallpaper and the shell. The shell owns notifications, clipboard services, plugin workers and authorization dialogs.
  5. Publish ready.json once the shell covers its output, then start xdg-desktop-autostart.target.
VariableEffect
ENZUI_DESKTOP_SESSION=installedInstalled-session behaviour instead of nested isolation
ENZUI_ALLOW_SYSTEM_POWER=1Allows explicit system power actions
ENZUI_PLUGIN_ISOLATION=delegatedRequires owned, bounded plugin cgroups
ENZUI_TERMINALTerminal started by Super + Return

The supervisor relaunches a crashed shell while keeping the compositor and apps running. More than three crash restarts in a minute end the login. Logout or compositor exit returns control to greetd.

Locking uses ext-session-lock. If the lock client fails, the compositor keeps outputs covered while the supervisor tries to bring the prompt back. logind unlock signals cannot bypass authentication.

Compositor configuration

The compositor is configured in Lua under config/. hyprland.lua loads the policy modules (panel-policy.lua, workspace-policy.lua, sidebar-policy.lua, shell-keys.lua and others). Shell commands are dispatched as compositor events named enzui-command:<name> — for example shell-keys.lua binds Super + L to enzui-command:lock, so locking always goes through the shell.

User-chosen shortcuts are applied by shortcut-map.lua, which remaps live bindings through a saved chord map without replacing binding handles. The default shortcut list and the chords the desktop reserves are defined in shell/src/shortcut_map.rs.

Portals

config/portal/enzui-portals.conf routes XDG desktop portals in the installed session:

InterfaceBackend
FileChooser, Access, BackgroundenzUI
Settings (colour scheme)enzUI, other keys fall through
ScreenCastenzUI remote, then Hyprland
RemoteDesktopenzUI remote
Screenshot, GlobalShortcutsHyprland
PrintGTK
Everything elseHyprland, then GTK

The file chooser returns selected files without opening them. For remote desktop sessions, screen selection comes before an explicit view-or-control decision, and an unanswered control prompt grants no input devices.

Privileged clients

With ENZUI_PRIVILEGED_CLIENTS=enforce, the compositor filters the screen-capture globals (zwlr_screencopy_manager_v1, ext_image_copy_capture_manager_v1 and related) and the virtual-input globals (zwlr_virtual_pointer_manager_v1, zwp_virtual_keyboard_manager_v1). An ordinary app cannot gain them by copying or renaming a trusted binary.

RouteMay use
The shell (exact live child of the verified supervisor)Input
A helper announced by the shellThe announced capture or input, once
Approved portal executablesCapture
The remote-desktop portalInput, still behind its own consent flow
Root grants for named system unitsNamed capture or input

Peers are pinned by pidfd (SO_PEERPIDFD), not a reusable numeric PID. LD_PRELOAD or LD_AUDIT on an executable route refuses admission. Locking disconnects every admitted client except the shell. The enforcement lives in patches/hyprland/privileged-clients.patch.

Settings and agent access

Settings is single-instance and can run windowless. D-Bus activation starts enzui-settings --agent-background on demand; desktop launches use routes such as enzui-settings:display. An idle background instance exits.

Agents reach Settings only through the MCP Center, which remains the permission engine. Settings exposes four functions — settings.list, settings.get, settings.set and settings.set_system — over a fixed allowlist of keys defined in shell/src/settings_agent.rs. Examples are appearance.dark_mode, shell.bar_position, windows.tiling, display.night_light and system.time_zone. Computer-wide changes (settings.set_system) still need polkit approval. See MCP Center.

System-level controls in Settings talk to org.enzimos.System1 and other OS services; see Settings backend API.

Shell plugins

A plugin is a single .enzplugin file: a JSON manifest with an embedded Python 3 program. The shell never runs it in-process. Each plugin runs in a bubblewrap sandbox with no network, a private filesystem, a seccomp filter and memory and CPU limits, and talks to the shell over newline-delimited JSON on stdin/stdout.

json
{
  "format": 1,
  "id": "cpu-meter",
  "name": "CPU meter",
  "version": "1.0.1",
  "description": "Total CPU use sampled from /proc/stat.",
  "permissions": ["shell.bar", "shell.panels"],
  "elements": [{"id": "usage", "section": "end", "before": "builtin.controls"}],
  "settings": [
    {"key": "interval_seconds", "label": "Sample every (seconds)",
     "kind": "integer", "default": 2, "min": 1, "max": 10}
  ]
}

The worker sends hello, receives start with its configuration and actual grants, then publishes declarative snapshot messages describing its bar element and panel. It must answer ping with pong. Frames are limited to 64 KiB.

PermissionAllows
shell.bar, shell.panelsBar elements and panels
shell.themeRecolouring the shell (up to four colours)
shell.layoutMoving or hiding bar items
shell.behaviorOpening shell views after a click
clipboard.read, clipboard.writeClipboard history and restoring entries after a click
notifications.readRead-only notification previews
applications.surfaceThe host-rendered application dock
storage.persistentPrivate plugin data on disk

Requested permissions are not grants; the person installing the plugin approves them, and installation is bound to the package's content. Bundle a package with:

sh
scripts/package-plugin my-plugin ~/my-plugin.enzplugin

Flatpak apps can ship plugins too. Declare them under [package.metadata.enzui.shell-plugins] in Cargo.toml and run tools/shell-plugins/export.py, which emits a Flatpak module installing the package under share/enzui/shell-plugins/. The host discovers such plugins disabled and asks for review. The shell's parser in shell/src/plugins/manifest.rs is authoritative.

Search providers

Apps add results to Quick Search through D-Bus. An app installs a declaration at $XDG_DATA_DIRS/enzui/search-providers/<desktop-id>.ini:

ini
[enzUI Search Provider]
DesktopId=io.github.enzui.Mail.desktop
BusName=io.github.enzui.Mail
ObjectPath=/io/github/enzui/Mail/SearchProvider
Version=1
MinQueryLength=2

and serves dev.enzui.SearchProvider1:

MemberSignaturePurpose
Search(s query, a{sv} options) → aa{sv}Results for one query
Activate(s id, s query, a{sv} options) → ()Open a chosen result
LaunchSearch(s query, a{sv} options) → ()Open the app's own search
Versionproperty u1

A result has a required id and title, and optional subtitle, icon and score (0.0–1.0). The bus name must be exactly the desktop ID without .desktop. Search calls are made with D-Bus auto-start suppressed, about 120 ms after typing pauses, with a 1.5 s deadline. Search must never map or raise a window. Existing GNOME SearchProvider2 providers also work, but start switched off.

Test a provider with enzui-search-probe <declaration.ini> [query…]. enzui-search-demo-provider --install DIR installs a sample provider.

Packaging the desktop

scripts/build-release --bin-dir .build/NEW/bin builds the shipped binary set, and scripts/export-desktop writes a relocatable tree into an empty DESTDIR. PREFIX/share/enzui/manifest.json describes every owned file with its mode and hash, required and optional runtime dependencies, installed component roots, source revisions, patch hashes, licences and build receipts. The exporter refuses mismatched bytes, pins or dirty sources. A compositor and its ABI-matched plugin always ship together. How the OS stages this export into an image is covered in Building from source.