<!--
SPDX-FileCopyrightText: 2026 ChromiumOS-Guy <chromiumos-guy-opensource@proton.me>
SPDX-License-Identifier: GPL-3.0-or-later
-->

## About
[XDG Desktop Portal](https://flatpak.github.io/xdg-desktop-portal/) for [Lomiri](https://lomiri.com/) is Lomiri's backend implementation of the xdg-desktop-portal D-Bus API. It provides a secure, sandbox-friendly bridge between sandboxed applications (Flatpak, Snap, etc.) and Lomiri desktop services (contenthub, notifications, url-dispatcher, etc.) by implementing the portal interfaces expected by xdg-desktop-portal.

## Resources

* Specification: https://flatpak.github.io/xdg-desktop-portal/docs/for-desktop-developers.html

* Development Tracking: https://gitlab.com/ubports/development/core/xdg-desktop-portal-lomiri/-/boards

## Requirements

To build this project, you need a C++ compiler compatible with [this version](CMakeLists.txt#L7) and the following development headers:

* **CMake** (version 3.16 or higher)
* **Qt 6** (qt6-base-dev qt6-declarative-dev qt6-base-dev-tools libqt6dbus6)
* **Build Essentials** (gcc, g++, make)
* **xdg-desktop-portal-dev** (xdg desktop portal xml spec files)

On Debian-based systems install them with:
```bash
sudo apt update
sudo apt install build-essential cmake qt6-base-dev qt6-declarative-dev qt6-base-dev-tools libqt6dbus6 xmlstarlet xdg-desktop-portal-dev
```

## Build

The project uses a standard CMake out-of-source build. This will compile the core desktopportal and all portals defined in `src/portals/`.

```bash
# Create and enter the build directory
mkdir build && cd build

# Configure the project
# Prefix is set to /usr so that D-Bus service and Portal files 
# are placed in the correct system-wide locations.
cmake .. -DCMAKE_INSTALL_PREFIX=/usr

# Build the project
make
```

### Installation
Installing the project will place the executable in `/usr/bin` and register the D-Bus service and XDG portal backend configuration.

```bash
# From your build directory:
sudo make install
```

## Notes
The communication channel is [this](https://matrix.to/#/#xdg-desktop-portal-lomiri:das-netzwerkteam.de) matrix room.

### TODO:
 * echo 'export XDG_CURRENT_DESKTOP=Lomiri' >> ~/.profile (will need to include)
 * offload UI from [main](src/main.cpp#L22).

