Skip to content

Implement XDG Desktop Portal Settings D-Bus service in Rust#1

Merged
jwinarske merged 4 commits intomainfrom
copilot/implement-dbus-settings-workspace
Nov 16, 2025
Merged

Implement XDG Desktop Portal Settings D-Bus service in Rust#1
jwinarske merged 4 commits intomainfrom
copilot/implement-dbus-settings-workspace

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

Implements a minimal D-Bus service for org.freedesktop.impl.portal.Settings with all documented settings from the XDG portal specification.

Architecture

Workspace structure:

  • portal_setting - Library implementing the D-Bus interface with type-safe settings storage
  • portal_setting_cli - Service executable that registers and serves the D-Bus interface
  • portal_setting_client - Integration test client that exercises all settings

Implementation

Settings coverage:

  • org.freedesktop.appearance: color-scheme (u32), accent-color (f64 tuple), contrast (u32)
  • org.gnome.desktop.interface: gtk-theme, icon-theme, cursor-theme, font-name, monospace-font-name, clock-format (all strings)
  • org.gnome.desktop.privacy: remember-recent-files (bool), recent-files-max-age (i32)

Key features:

  • Type validation on setting updates with signature checking
  • Namespace-based filtering in ReadAll operations
  • Thread-safe async storage using Arc<RwLock<HashMap>>
  • zbus 4.0 interface macros for D-Bus integration

CI workflow:

  • Builds workspace and runs unit tests
  • Integration test runs service + client in dbus-run-session
  • On tag push: publishes release binary as GitHub artifact

Usage

# Start the service
cargo run --bin portal-setting-service

# In another terminal, test all settings
cargo run --bin portal-setting-client

The service registers at org.freedesktop.impl.portal.Settings and serves the interface at /org/freedesktop/portal/desktop per XDG portal conventions.

Original prompt

Implement a Rust workspace containing:

  • portal_setting: a library crate that implements the D-Bus interface org.freedesktop.impl.portal.Setting and supports all known settings as documented at https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html. It provides type-checking on setting update, and filtering on key listing.
  • portal_setting_cli: an executable crate that runs the D-Bus service using the library.
  • portal_setting_client: a test executable that exercises all settings for read/write, confirming values.
  • A thorough README with usage instructions and documentation.
  • A CI workflow (.github/workflows/ci.yml) that builds, runs tests, and publishes a release artifact.
  • CI workflow should build the workspace, run the client test against the server, and on tag push, publish the built executable as a release.

Refer to detailed design and sample files in conversation. All files below must be created:
*Cargo.toml (workspace)
*portal_setting/Cargo.toml, src/lib.rs
*portal_setting_cli/Cargo.toml, src/main.rs
*portal_setting_client/Cargo.toml, src/main.rs
*README.md
*.github/workflows/ci.yml

The CI workflow should:

  • Build all workspace members
  • Run tests (ensure service and client interaction)
  • On new tag push, build release binary for cli and publish as GitHub release artifact.

This pull request was created as a result of the following prompt from Copilot chat.

Implement a Rust workspace containing:

  • portal_setting: a library crate that implements the D-Bus interface org.freedesktop.impl.portal.Setting and supports all known settings as documented at https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html. It provides type-checking on setting update, and filtering on key listing.
  • portal_setting_cli: an executable crate that runs the D-Bus service using the library.
  • portal_setting_client: a test executable that exercises all settings for read/write, confirming values.
  • A thorough README with usage instructions and documentation.
  • A CI workflow (.github/workflows/ci.yml) that builds, runs tests, and publishes a release artifact.
  • CI workflow should build the workspace, run the client test against the server, and on tag push, publish the built executable as a release.

Refer to detailed design and sample files in conversation. All files below must be created:
*Cargo.toml (workspace)
*portal_setting/Cargo.toml, src/lib.rs
*portal_setting_cli/Cargo.toml, src/main.rs
*portal_setting_client/Cargo.toml, src/main.rs
*README.md
*.github/workflows/ci.yml

The CI workflow should:

  • Build all workspace members
  • Run tests (ensure service and client interaction)
  • On new tag push, build release binary for cli and publish as GitHub release artifact.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 16, 2025 14:55
Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com>
Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com>
Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Rust workspace for D-Bus settings Implement XDG Desktop Portal Settings D-Bus service in Rust Nov 16, 2025
Copilot AI requested a review from jwinarske November 16, 2025 15:02
@jwinarske jwinarske marked this pull request as ready for review November 16, 2025 15:52
@jwinarske jwinarske merged commit 3f0d8bc into main Nov 16, 2025
4 checks passed
@jwinarske jwinarske deleted the copilot/implement-dbus-settings-workspace branch November 16, 2025 15:52
@jwinarske
Copy link
Contributor

@copilot The implementation is missing interface version, exposed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants