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)`: