Files
DroidDeck/tools/linuxfs/overlay/usr/local/bin/droiddeck-flatpak-run
T
The412Banner f722239bd9 feat: run x86-64 Flatpaks under FEX and add apps from a .flatpakrepo link
Flatpak sandboxes whose runtime is x86-64 now start under the rootfs's FEX,
with FEX's ARM64 libraries and a per-arch ld.so.preload bound in. The add-app
dialog takes a .flatpakrepo link (such as NVIDIA's GeForce NOW repo), Flathub
IDs fall back to the x86-64 build when there is no ARM64 one, and x86-64
apps are listed and launched with --arch=x86_64.
2026-10-19 21:18:27 +00:00

24 lines
956 B
Bash

#!/bin/bash
set -u
export FLATPAK_BWRAP=/usr/local/bin/droiddeck-bwrap
case ":${XDG_DATA_DIRS:-}:" in
*"/flatpak/exports/share:"*) ;;
*) export XDG_DATA_DIRS=$HOME/.local/share/flatpak/exports/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share} ;;
esac
socket=()
if [ -n "${BL_INSIDE:-}" ] || [ -n "${GAMESCOPE_WAYLAND_DISPLAY:-}" ]; then
unset WAYLAND_DISPLAY
export XDG_SESSION_TYPE=x11
socket=(--nosocket=wayland --socket=x11)
fi
# An app installed only for x86-64 is found only when asked for; droiddeck-bwrap starts it under FEX.
apps=$HOME/.local/share/flatpak/app
if [ -n "${1:-}" ] && [ -d "$apps/$1/x86_64" ] && [ ! -d "$apps/$1/$(flatpak --default-arch 2>/dev/null)" ]; then
socket+=(--arch=x86_64)
fi
echo "== flatpak run ${socket[*]} $*"
if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v dbus-run-session >/dev/null 2>&1; then
exec dbus-run-session -- flatpak run "${socket[@]}" "$@"
fi
exec flatpak run "${socket[@]}" "$@"