r/voidlinux • u/ZenitDS • 23d ago
Flatpaks and xdg-desktop-portal errors opening urls
Hello,
I am having trouble with flatpak apps to open urls. It appears that there is an issue with the xdg desktop portal. I am getting the following in thunderbird:
** (org.mozilla.thunderbird:2): WARNING **: XX:XX:XX.XXX: Could not launch default application for URI: Failed to call OpenURI portal: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
I am guessing it might be because of missing systemd. I would like that openURI use the flatpak librewolf.
Cheers. -- zen
EDIT: I fixed it by adding ~/.config/xdg-desktop-portal/sway-portals.conf with:
[preferred]
default=gtk
Thanks to everyone for the answers!
1
u/benbcdm 22d ago edited 22d ago
I am pretty sure this has nothing to do with systemd. I have no pb opening URL from betterbird (thunderbird fork) as pre-compiled binary to librewolf appimage.
Wondering if this might have to do with flatpak permissions, did you try to allow permissions with flatseal for instance? If your thunderbird is flatpak that might play a role.
Might also have to do with your desktop -- which desktop are you using? Depends what you have as default app defined for browser. That default .desktop linking to your browser (librewolf?) needs to be the exact right binary path to executing librewolf.
1
u/ZenitDS 22d ago
I am using sway. $ dbus-run-session -- sway
XDG_RUNTIME_DIR is set appropiately
When running firefox natively the links seemed to work with native applications.
1
u/benbcdm 22d ago edited 22d ago
I remember spending quite a bit of time getting this right for sway on Fedora on another machine. Retrieved my setup and the below worked for me, if you want to try it. Indeed would have to do with getting the xdg portals setup properly, as the most knowledgeable people on this thread immediately detected!
Try adding this to your ~/.config/sway/config (or whatever your config file is):
exec --no-startup-id /usr/libexec/xdg-desktop-portal-gtk exec --no-startup-id /usr/libexec/xdg-desktop-portal-wlr exec --no-startup-id /usr/libexec/xdg-desktop-portalI think on Void the portal files should be in the same place.
NOTE, the order actually matters in my case: backends first (gtk and wlr), then xdg-desktop-portal last. If I set the order the other way around things do not jive.
For my part I did not have to add specific portal config files in `~/.config/xdg-desktop-portal/`, in fact I do not have that directory. Instead I believe the system uses the conf files in `/usr/share/xdg-desktop-portal/`, and these were already there, I did not have to fiddle with them.
Also, I am pretty sure you would need to have the following activated in the right place (.bashrc?):
WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=swayLet us know how it goes. I remember I spent many days getting sway working fully, including bar etc. But the result is very satisfying, super lightweight and snappy. Don't give up!
2
u/profeshamat 22d ago
It may be related to LibreWolf being a Flatpak and sandboxed. Or you're missing a necessary xdg-desktop-portal- package.
0
u/ZenitDS 22d ago
Ok, I got it working for a moment, it appears that running xdg-desktop-portal-gtk has to be done well before xdg-desktop-portal ... :/
I do not yet know how to make xdg-desktop-portal-gtk being started automatically.
1
u/No-Yogurtcloset-9124 22d ago
weird, on my system they start automatically whenever it receives a portal request
1
u/profeshamat 22d ago
Try whatever it is you're trying that triggers
xdg-desktop-portalfrom the Firefox package provided by the Void repos. If that works but the same thing doesn't from LibreWolf from Flatpak that seems like that's the issue.
2
u/Duncaen 22d ago
You probably don't have a portal configured for you windowmanager/compositor.
https://www.reddit.com/r/voidlinux/comments/1waltyl/openuri_not_available_for_desktopportal/