Skip to content
  1. Docs
  2. enzUI framework
  3. Developers

Packaging

One application identity for the desktop entry, metainfo, icon, D-Bus and search files and the window, plus distribution and Flatpak builds.

A Linux desktop knows an application through files that must all carry the same application id: the desktop entry, the AppStream metainfo, the icon, the D-Bus service file and the search provider files. The window's Wayland app id must match the desktop entry too, or the compositor shows a generic icon and groups the window under the wrong entry. enzUI keeps that identity in one value, enzui_core::packaging::AppPackage, and generates every file from it.

1. Choose the id

Use reverse-DNS: a domain you control, reversed, then the app name, such as org.example.Notes. The id needs at least two dot-separated elements of ASCII letters, digits, _ and -, none starting with a digit (enzui_core::packaging::validate_app_id). Flathub also wants at least three elements and a proven domain. Pick the final id early: it appears in user data paths and settings, and changing it later loses them.

2. Describe the application once

rust
use enzui_core::packaging::{AppPackage, Release};

fn package() -> AppPackage {
    AppPackage::new("org.example.Notes", "Notes", "Write things down", "notes")
        .expect("a valid identity")
        .description(["Notes keeps short formatted notes and finds them again."])
        .developer("org.example", "The Example Team")
        .categories(["Office"])
        .keywords(["memo"])
        .mime_types(["text/markdown"])
        .project_license("GPL-3.0-or-later")
        .homepage("https://example.org/notes")
        .bug_tracker("https://example.org/notes/issues")
        .release(Release {
            version: "1.0.0".into(),
            date: "2026-10-21".into(),
            notes: vec!["First release.".into()],
        })
        .translation("de", "Notizen", "Dinge aufschreiben")
        .icon_svg(include_str!("../data/org.example.Notes.svg"))
}

The arguments to new are the id, name, summary and command (the executable's name in the prefix's bin). With .mime_types(..), the desktop entry passes opened files on the command line (Exec=notes %U).

3. Give windows the same id

rust
use enzui_widgets::app_shell::DesktopApplicationIdentity;

let identity = DesktopApplicationIdentity::for_package(&package());
iced::application(App::new, App::update, App::view)
    .window(identity.apply_to_window_settings(iced::window::Settings::default()));

Every window should get its settings through the same identity (window_settings, secondary_window_settings, content_window_settings).

4. Activation and search (optional)

A single-instance app serves org.freedesktop.Application under its id with ApplicationService::connect(id). Mark the package .dbus_activatable(true): the desktop entry then says DBusActivatable=true and a service file lets the bus start the app for a launcher or notification action. An app that serves search adds .search_provider(true), which also installs the GNOME Shell provider file and the KRunner plugin.

5. Install the files

AppPackage::files(prefix) lists every file with its path and contents; AppPackage::write(root, prefix) writes them under a staging root.

FilePath under the prefix
Desktop entryshare/applications/<id>.desktop
Metainfoshare/metainfo/<id>.metainfo.xml
Iconshare/icons/hicolor/scalable/apps/<id>.svg
D-Bus service (activatable only)share/dbus-1/services/<id>.service
GNOME Shell search provider (search only)share/gnome-shell/search-providers/<id>.search-provider.ini
KRunner plugin (search only)share/krunner/dbusplugins/<id>.desktop

The service file names the executable by its full path, so write the files for the prefix the package installs to: /usr for a distribution package, /app in a Flatpak.

The simplest build step is the application itself. The app example writes its files when started as app --write-package-files ROOT PREFIX, so the identity the window uses and the identity the files carry cannot differ. For a distribution package:

sh
cargo build --release
install -Dm755 target/release/notes "$DESTDIR/usr/bin/notes"
target/release/notes --write-package-files "$DESTDIR" /usr

A manual install then runs update-desktop-database and gtk-update-icon-cache; distribution packaging tools do this themselves.

6. Check what is installed

AppPackage::check(root, prefix) reads an installed tree back and reports every file that is missing or disagrees with the identity. Run it in a test against the staged tree, next to the reference validators:

sh
desktop-file-validate "$DESTDIR/usr/share/applications/org.example.Notes.desktop"
appstreamcli validate --no-net "$DESTDIR/usr/share/metainfo/org.example.Notes.metainfo.xml"

7. Flatpak

The repository's docs/packaging/org.enzui.AppExample.yml builds the app example:

sh
flatpak-builder --user --install --force-clean build-dir docs/packaging/org.enzui.AppExample.yml
flatpak run org.enzui.AppExample

The manifest's key parts:

text
id: org.enzui.AppExample
runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.rust-stable
command: app
finish-args:
  - --socket=wayland
  - --device=dri
modules:
  - name: app-example
    buildsystem: simple
    build-commands:
      - cargo build --release --locked --example app
      - install -Dm755 target/release/examples/app /app/bin/app
      - /app/bin/app --write-package-files / /app
  • Runtime: org.freedesktop.Platform with the rust-stable SDK extension. enzUI needs no GNOME or KDE runtime.
  • Permissions: The manifest grants the sample app Wayland and GPU access. File choosers, links, notifications, settings and the other portals need no permission. Add --share=network only for an app that uses the network.
  • D-Bus: a sandboxed app may own its own id on the session bus, which ApplicationService::connect needs; no --own-name is required.
  • Offline builds: the example gives cargo network access during the build. Flathub builds offline: generate cargo-sources.json with flatpak-cargo-generator.py Cargo.lock, add it to the sources and build with cargo --offline.

Licence notices

Install third-party notices beside the binary, for example under /usr/share/licenses/<app id>/:

  • enzUI's own LICENSE, which also lists the embedded Lucide icons.
  • iced's MIT LICENSE from the pinned iced fork, covering iced and its embedded Iced-Icons.ttf.
  • With iced's fira-sans feature, FiraSans-Regular.OFL.txt from graphics/fonts/ in the iced fork.
  • The licences of your crates.io dependencies, as cargo about or a similar tool collects them.

Checklist

  • One id everywhere: desktop entry file name, Icon, StartupWMClass, the window app id, metainfo <id> and <launchable>, service Name, search provider BusName, the owned D-Bus name and the Flatpak app id.
  • The desktop entry's and service file's Exec run the installed binary.
  • A scalable icon, or PNGs at 48, 64 and 128 pixels at least.
  • Metainfo with a description, licence, developer, release and, for a software centre listing, screenshots.
  • The licence notices above, installed with the binary.

Apps that embed web content also install the WPE engine's credential guard; see Platform support.