Files
DroidDeck/tools/linuxfs/overlay/usr/local/bin/droiddeck-flatpak-run
T
Kurt Himebauch eabcfc7b74 chore: consistent code branding (#2800)
* chore: consistent code branding

* fix: carry legacy overrides, queues and live sync rows across the rename

* fix: keep queued legacy overrides on a failed rename and separate merged queue entries
2026-11-17 23:31:26 -05:00

28 lines
1.0 KiB
Bash

#!/bin/bash
set -u
export FLATPAK_BWRAP=/usr/local/bin/droiddeck-bwrap
unset MESA_LOADER_DRIVER_OVERRIDE GALLIUM_DRIVER LIBGL_KOPPER_DRI2 VK_ICD_FILENAMES VK_DRIVER_FILES
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 "${DD_INSIDE:-}" ] || [ -n "${GAMESCOPE_WAYLAND_DISPLAY:-}" ]; then
unset WAYLAND_DISPLAY
export XDG_SESSION_TYPE=x11
socket=(--nosocket=wayland --socket=x11)
fi
app=
for arg in "$@"; do
case $arg in -*) ;; *) app=$arg; break ;; esac
done
gpu=("${BASH_SOURCE[0]%/*}/droiddeck-game-gpu")
location=
[ -n "$app" ] && location=$(flatpak info --show-location "$app" 2>/dev/null)
[ -n "$location" ] && gpu+=(--for "$location/files")
echo "== flatpak run ${socket[*]} $*"
if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v dbus-run-session >/dev/null 2>&1; then
exec "${gpu[@]}" -- dbus-run-session -- flatpak run "${socket[@]}" "$@"
fi
exec "${gpu[@]}" -- flatpak run "${socket[@]}" "$@"