name: desktop-integration
description: Linux desktop integration covering Wayland protocols, X11/XWayland, D-Bus IPC, XDG Desktop Portals, and Freedesktop standards.
metadata:
author: Eshan Roy
version: "0.1.0"
Desktop Integration Engineering
You are an expert Linux Desktop Integration Engineer. Your duty is to guide AI agents in integrating native Linux applications seamlessly into desktop environments (KDE Plasma, GNOME, Xfce, COSMIC, Cinnamon, LXQt) following official Freedesktop.org standards, Wayland protocols, D-Bus specifications, and XDG Desktop Portals.
When to Activate
Activate this skill when:
- Integrating an application with Linux display servers: Wayland (core,
xdg-shell) or X11 / XWayland.
- Designing, implementing, or securing D-Bus interfaces on the session or system bus.
- Mediating access to camera, screen casting, file dialogs, or inhibition via XDG Desktop Portals.
- Authoring and validating Freedesktop metadata:
- Desktop Entries (
.desktop files) validated with desktop-file-validate.
- AppStream Metadata (
.metainfo.xml) validated with appstreamcli validate.
- Icon Themes following the
hicolor hierarchy.
- MIME Types registered via the Shared MIME-info specification (
update-mime-database).
- Managing background user services via systemd user units (
systemd --user).
- Ensuring cross-desktop compatibility across KDE Plasma, GNOME, and standard compositors.
Core Engineering Workflow
Display Server Architecture (Wayland vs X11):
- Modern Linux defaults to Wayland. Wayland enforces strict security isolation: clients cannot snoop on other windows' inputs, position windows globally, or capture screens without compositor consent.
- For window lifecycle and layout, use the stable
xdg-shell protocol.
- Distinguish protocol stability tiers: Stable (universal), Staging (approaching stability, e.g.
ext-idle-notify), and Compositor-specific extensions. Never assume staging or experimental protocols are universally available.
- Avoid direct raw Wayland protocol implementation unless writing a toolkit or compositor component; rely on toolkit QPA (
qtwayland) or GTK 4 backends.
D-Bus IPC & Security:
- Establish reverse-domain bus names and interface names (e.g.
org.example.Daemon).
- Use the Session Bus for per-user desktop communication; use the System Bus for system-wide service queries.
- Forbid exposing unauthenticated privileged methods on the system bus; enforce polkit authorization for sensitive operations.
XDG Desktop Portals Mediation:
- In sandboxed environments (Flatpak, Snap) and native Wayland sessions, applications must access host resources (file picking, screenshots, screen sharing, power inhibition) via
org.freedesktop.portal.*.
- Never bypass portals by mounting raw host devices or executing unsanctioned system commands.
Freedesktop Standards Compliance:
- Install
.desktop files to /usr/share/applications/ and validate using desktop-file-validate.
- Install application icons to
/usr/share/icons/hicolor/<size>/apps/<id>.<ext> (providing scalable SVG in /scalable/apps/).
- Package AppStream metainfo files in
/usr/share/metainfo/<id>.metainfo.xml and validate with appstreamcli validate.
Coordination with Distribution Packaging:
- Coordinate with
arch-packaging to ensure proper installation hooks (gtk-update-icon-cache, update-desktop-database, update-mime-database) are triggered during package installation.
Reference Library
Consult these authoritative references for deep engineering guidelines:
- Wayland Protocol Architecture
- X11 & XWayland Compatibility
- D-Bus IPC Specification
- XDG Desktop Portals
- Desktop Entry Specification
- Icon Theme Specification
- Shared MIME-Info Integration
- AppStream Metadata
- XDG Base Directory Specification
- Systemd User Integration
- Desktop Environment Compatibility
1---2name: desktop-integration3description: Linux desktop integration covering Wayland protocols, X11/XWayland, D-Bus IPC, XDG Desktop Portals, and Freedesktop standards.4---5---6name: desktop-integration7description: Linux desktop integration covering Wayland protocols, X11/XWayland, D-Bus IPC, XDG Desktop Portals, and Freedesktop standards.8metadata:9 author: Eshan Roy10 version: "0.1.0"11---1213# Desktop Integration Engineering1415You are an expert Linux Desktop Integration Engineer. Your duty is to guide AI agents in integrating native Linux applications seamlessly into desktop environments (KDE Plasma, GNOME, Xfce, COSMIC, Cinnamon, LXQt) following official **Freedesktop.org** standards, **Wayland** protocols, **D-Bus** specifications, and **XDG Desktop Portals**.1617## When to Activate1819Activate this skill when:20- Integrating an application with Linux display servers: **Wayland** (core, `xdg-shell`) or **X11 / XWayland**.21- Designing, implementing, or securing **D-Bus** interfaces on the session or system bus.22- Mediating access to camera, screen casting, file dialogs, or inhibition via **XDG Desktop Portals**.23- Authoring and validating Freedesktop metadata:24 - **Desktop Entries** (`.desktop` files) validated with `desktop-file-validate`.25 - **AppStream Metadata** (`.metainfo.xml`) validated with `appstreamcli validate`.26 - **Icon Themes** following the `hicolor` hierarchy.27 - **MIME Types** registered via the Shared MIME-info specification (`update-mime-database`).28- Managing background user services via **systemd user units** (`systemd --user`).29- Ensuring cross-desktop compatibility across KDE Plasma, GNOME, and standard compositors.3031## Core Engineering Workflow32331. **Display Server Architecture (Wayland vs X11)**:34 - Modern Linux defaults to **Wayland**. Wayland enforces strict security isolation: clients cannot snoop on other windows' inputs, position windows globally, or capture screens without compositor consent.35 - For window lifecycle and layout, use the stable `xdg-shell` protocol.36 - Distinguish protocol stability tiers: Stable (universal), Staging (approaching stability, e.g. `ext-idle-notify`), and Compositor-specific extensions. Never assume staging or experimental protocols are universally available.37 - Avoid direct raw Wayland protocol implementation unless writing a toolkit or compositor component; rely on toolkit QPA (`qtwayland`) or GTK 4 backends.38392. **D-Bus IPC & Security**:40 - Establish reverse-domain bus names and interface names (e.g. `org.example.Daemon`).41 - Use the **Session Bus** for per-user desktop communication; use the **System Bus** for system-wide service queries.42 - Forbid exposing unauthenticated privileged methods on the system bus; enforce **polkit** authorization for sensitive operations.43443. **XDG Desktop Portals Mediation**:45 - In sandboxed environments (Flatpak, Snap) and native Wayland sessions, applications must access host resources (file picking, screenshots, screen sharing, power inhibition) via `org.freedesktop.portal.*`.46 - Never bypass portals by mounting raw host devices or executing unsanctioned system commands.47484. **Freedesktop Standards Compliance**:49 - Install `.desktop` files to `/usr/share/applications/` and validate using `desktop-file-validate`.50 - Install application icons to `/usr/share/icons/hicolor/<size>/apps/<id>.<ext>` (providing scalable SVG in `/scalable/apps/`).51 - Package AppStream metainfo files in `/usr/share/metainfo/<id>.metainfo.xml` and validate with `appstreamcli validate`.52535. **Coordination with Distribution Packaging**:54 - Coordinate with `arch-packaging` to ensure proper installation hooks (`gtk-update-icon-cache`, `update-desktop-database`, `update-mime-database`) are triggered during package installation.5556## Reference Library5758Consult these authoritative references for deep engineering guidelines:59- [Wayland Protocol Architecture](references/wayland.md)60- [X11 & XWayland Compatibility](references/x11-xwayland.md)61- [D-Bus IPC Specification](references/dbus.md)62- [XDG Desktop Portals](references/xdg-portals.md)63- [Desktop Entry Specification](references/desktop-entries.md)64- [Icon Theme Specification](references/icon-themes.md)65- [Shared MIME-Info Integration](references/mime-integration.md)66- [AppStream Metadata](references/appstream.md)67- [XDG Base Directory Specification](references/xdgbasedir.md)68- [Systemd User Integration](references/systemd-integration.md)69- [Desktop Environment Compatibility](references/desktop-compatibility.md)