xdg-open not working
This is a continuation of #147, at the moment xdg-open is not working as intended,
$ /usr/bin/xdg-open somepdf.pdf
gio: file:somepdf.pdf: No application is registered as handling this file
/usr/bin/xdg-open "https://www.google.cl"
gio: https://www.google.cl: Operation not supported
The expected behaviour should be to open using the host default application, a possible fix is to create a xdg-open script in your path with contents
#!/bin/sh
${TOOLBOX_PATH:+flatpak-spawn --host} /usr/bin/xdg-open "$@"
So, if I understand it correctly, from #147, the flatpak-spawn method is the intended solution (even though it was split from flatpak, the name is just for historical purposes). I guess this script would have to be dropped in the image somewhere where it can override the builtin xdg-open.
Having this script in the image would prevent a lot of headaches. I currently ran into this issue when trying to open links from VS Code running inside Toolbox. I'm happy to submit a PR if we can figure out where it should live.
This should work by default if toolbox is to be the required tool to do development work in a Fedora Silverblue or similar immutable systems. Many web development tools launch a browser when building, for example, and right now using toolbox with those tools throws really strange errors.
I am using the fix specified in the body of this issue, and it works for me, so at least a workaround is possible. Said that, I think it is pretty necessary for this to work by default.
flatpak-xdg-open does work inside Toolbox, so the alternative fix is to use flatpak-xdg-utils as a drop-in replacement for xdg-utils specifically for Toolbox.
For anyone still interested in this, here's my workaround (tested on Fedora Silverblue 35):
[yana@host ~]$ toolbox enter
[yana@toolbox ~]$ sudo dnf install flatpak-xdg-open
[yana@toolbox ~]$ sudo ln -s /usr/bin/flatpak-xdg-open /usr/bin/xdg-open
For anyone still interested in this, here's my workaround (tested on Fedora Silverblue 35):
[yana@host ~]$ toolbox enter [yana@toolbox ~]$ sudo dnf install flatpak-xdg-open [yana@toolbox ~]$ sudo ln -s /usr/bin/flatpak-xdg-open /usr/bin/xdg-open
in Fedora Silverblue 39 this packages is called flatpak-xdg-utils now. Just in case someone has trouble to find it.
So we have a functioning workaround but not a proper upstream fix for it so far. Let me propose the following
Update the Fedora 39 container image
- Add
flatpak-xdg-utilsto theextra-packagesfile of the container image - Link
/usr/bin/xdg-opento/usr/bin/flatpak-xdg-openin the container file
~~There is however one thing I am not certain about. What happens when the xdg-utils package inside
of the container gets updated, e.g. through sudo dnf upgrade. Does it overwrite /usr/bin/xdg-open and
thus the link is gone?~~
The above concern is irrelevant, because the xdg-utils is not installed by default on the Fedora 39 image.
On a site note: Does it make sense to make this issue part of Project Pickle?