I discovered that the issue has nothing to do with xdg-desktop-portal.
Other D-Bus activated services also does not start.

I assume this has something to do with the lack of the
DBUS_SESSION_BUS_ADDRESS environment variable. I tried to import it from
systemd (using exec systemctl --user import-environment
DBUS_SESSION_BUS_ADDRESS in the Sway configuration), but this didn't
help. The variable is there, but services still are not activated.

The only way for me is to use dbus-launch (eg dbus-launch notify-send or
eval $(dbus-launch)).

What is the proper way to get this variable set? I start Sway from
.bashrc:

if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then                          
       export XDG_CURRENT_DESKTOP=sway                                          
        exec systemd-cat --identifier=sway sway
fi

Best regards,
Radek

Reply via email to