Issue with xdg-open in sway

Hello everyone

Im having issues with getting default application to work. For example clicking links in the terminal results in this error:

Running xdg-open results in the same thing.

With verbose output XDG_UTILS_DEBUG_LEVEL=2 xdg-open results in:

Selected DE flatpak
(objectpath '/org/freedesktop/portal/desktop/request/1_80/t',)

And the same error popup of course.

My full nixos config can be found at GitHub - ketamin00/nixos-config: Personal NixOS Config

Relevant snippets:

XDG portals:

xdg.portal = {
    enable = true;
    wlr.enable = true;
    extraPortals = [
    config = {
      common.default = ["gtk" "wlr"];

XDG mime stuff:

xdg = {
    enable = true;
    mime.enable = true;
    mimeApps = {
      enable = true;
      defaultApplications = {
        "x-scheme-handler/http" = ["firefox.desktop"];
	"x-scheme-handler/https" = "firefox.desktop";
    userDirs = {
      enable = true;
      createDirectories = true;

Really stumped about this issue, any help or pointers to relevant ressources are appreciated

I have found a solution which seems to fix the issue (fix for xdg issue · ketamin00/nixos-config@5eb178a · GitHub). Instead of running sway through 'sway' i run it through dbus-run-session sway.

Im still interested in hearing of any other solutions, as this doesn’t seem like a great solution. I still have no idea what caused the issue

1 Like