Flatpak-spawn not installed on Sway Atomic

I installed Sway Atomic 43 a few days ago and noticed that the flatpak-spawn program was missing. Was it left out of Sway Atomic (or maybe all Atomic distros) for a reason or was this just an oversight?

Why would you need it? It’s usually installed from within Flatpaks as needed.

Thanks. In my case it would be running an application installed in toolbox (yt-dlp) called from a flatpak application (mpv). I’ve used it when the flatpak version of mpv was running behind on updates to yt-dlp. I had this working with flatpak-spawn in another distro with distrobox, so I think it would work with toolbox as well.

From what I’ve read it seems like flatpak-spawn is what’s suggested for this type of scenario, but I’m willing to try whatever might work. I’m guessing I could also overlay the package containing flatpak-spawn, I just try to keep overlays to a minimum (preferably none).

So if I read this correctly, you would have to run flatpak-spawn to go outside the Flatpak sandbox, then chain that with toolbox run to run the command from your toolbox:

$ flatpak-spawn toolbox run yt-dlp ...

Not sure that will work.

That could be true, it might not work with toolbox for some reason (or I’m missing something else). In Sway Atomic I did overlay the flatpak-spawn package, reboot, and then configure it the same way as another system (UBlue Aurora) where it did work. I tried a variety of things but could never get it to work with toolbox in Sway Atomic. The most common error message was about ytdl_hook not being able to start a subprocess. I did remove the flatpak-spawn overlay, so I’m not able to get those exact error messages at the moment (but I could set it up again if needed).

Aurora also has the flatpak-spawn package installed, which is why I chose to overlay it in Sway Atomic instead of installing the flatpak-xdg-utils package.

This is the working setup In Aurora with distrobox, to let you know what’s running and how it’s configured.
mpv is installed as a flatpak on the host. yt-dlp is installed in an Arch distrobox container. I exported yt-dlp from the distrobox container, which created the bash file ~/.local/bin/yt-dlp. The main line in that batch file is:

exec flatpak-spawn --host "/usr/bin/distrobox-enter"  -n arch  --  '/usr/bin/yt-dlp'  "$@"

In the mpv config file I have the following setting to tell mpv to use the distrobox yt-dlp program:

script-opts=ytdl_hook-ytdl_path=/home/myuser/.local/bin/yt-dlp

In Flatseal I also added org.freedesktop.Flatpak to the Session Bus Talks section.