Files
DroidDeck/tools/linuxfs/overlay/usr/local/bin/droiddeck-flatpak-run
T
MaxsTechReview 1760f008ae fix(desktop): Flatpak and Snap apps get the game GPU setting (#2295)
The session's TU_DEBUG=sysmem is meant for the Steam client and
Chromium-based apps. Flatpak and Snap apps inherited it, so emulators
and other programs installed that way rendered through system memory.

droiddeck-game-env now holds the Chromium check next to game_gpu, and a
small droiddeck-game-gpu wrapper applies both to any program. The
AppImage, Flatpak and Snap launchers use it, so the rule lives in one
place.
2026-11-08 14:39:31 -05:00

27 lines
972 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
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[@]}" "$@"