From 6e65be864d6dde5600929e9f18e3d9a08fe1ee70 Mon Sep 17 00:00:00 2001 From: Vladimir-csp <4061903+Vladimir-csp@users.noreply.github.com> Date: Sun, 15 Sep 2024 02:36:40 +0300 Subject: [PATCH] Avoid hardcoding XDG_CURRENT_DESKTOP, mention dbus implementation quirks --- XDG-Desktop-Portal-configuration.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/XDG-Desktop-Portal-configuration.md b/XDG-Desktop-Portal-configuration.md index 82532c4..9c7108d 100644 --- a/XDG-Desktop-Portal-configuration.md +++ b/XDG-Desktop-Portal-configuration.md @@ -4,11 +4,21 @@ Make sure you have installed both the `gtk` and `wlr` portal backends. ## Setup the environment From [xdg-desktop-portal-wlr](https://github.com/emersion/xdg-desktop-portal-wlr/tree/master?tab=readme-ov-file#running): -> Make sure `XDG_CURRENT_DESKTOP` is set. Make sure `WAYLAND_DISPLAY` and `XDG_CURRENT_DESKTOP` are imported into D-Bus. If you're running Sway, this can be added to your config file: -```sh -exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway +> Make sure `XDG_CURRENT_DESKTOP` is set. Make sure `WAYLAND_DISPLAY` and `XDG_CURRENT_DESKTOP` are imported into D-Bus. + +See [Systemd and dbus activation environments](https://github.com/swaywm/sway/wiki#systemd-and-dbus-activation-environments) + +If dbus implementation is `dbus-broker`, systemd activation environment is used: + ``` -`--systemd` can be omitted if you don't use it. +exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP:-sway:wlroots} +``` +If classic dbus is used, it has its own separate one: + +```sh +exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP:-sway:wlroots} +``` +`XDG_CURRENT_DESKTOP` should be passed through in case it was set before sway (i.e. by a Display Manager) ## Set the portals Sway should use From `portals.conf(5)`: