I will suggest to extend the export script to also support being executed from within a flatpak application, like IntelliJ, by testing for $FLATPAK_ID in the export script.
#!/bin/sh
# distrobox_binary
# name: apx-ubuntu
this=$(realpath $0)
if [ -n "$FLATPAK_ID" ]; then
exec "/usr/bin/flatpak-spawn" --host "/usr/share/apx/distrobox/distrobox-enter" -n apx-ubuntu -- $this "$@"
elif [ -z "${CONTAINER_ID}" ]; then
exec "/usr/share/apx/distrobox/distrobox-enter" -n apx-ubuntu -- $this "$@"
elif [ -n "${CONTAINER_ID}" ] && [ "${CONTAINER_ID}" != "apx-ubuntu" ]; then
exec distrobox-host-exec $this "$@"
else
exec '/usr/bin/docker' "$@"
fi
I will suggest to extend the export script to also support being executed from within a flatpak application, like IntelliJ, by testing for
$FLATPAK_IDin the export script.