mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
* feat: KDE desktop as a bottom-screen mode beside the top-screen session * test: bottom-desktop launch test sets DISPLAY instead of inheriting it * fix: drop the bottom desktop's launch when the session stops while preparing it * fix: bottom desktop restarts on a fresh surface, trackpad/touch toggle, loading throbber, DroidDeck's display driver * fix: bottom desktop pauses with the session and opens the keyboard for a tapped text field * fix: no bottom desktop guest starts or keeps running unfrozen while the session is paused * fix: bottom desktop treats a freeze in progress as paused * fix: only the session that began a freeze clears its pausing flag * fix: bottom desktop launch is stored and cleared only for its own session generation * fix: a stopped session tears down the bottom desktop it started even after a newer launch is prepared * fix: a new session's bottom desktop replaces one an earlier session left running * fix: release the bottom desktop's keyboard watcher when its compositor dies * fix: bottom desktop starts its guest only for the launch its compositor was attached for * fix: bottom desktop ignores compositor replies to an earlier session's attach
62 lines
2.5 KiB
Bash
Executable File
62 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
set -u
|
|
ui=${1:-desktop}
|
|
target=${2:-}
|
|
case $ui in desktop|bigpicture) ;; *) echo "usage: $0 desktop|bigpicture [appid|steam://url]" >&2; exit 64 ;; esac
|
|
url=
|
|
case $target in
|
|
"") ;;
|
|
steam://*) url=$target ;;
|
|
*[!0-9]*) echo "not an app id or steam:// URL: $target" >&2; exit 64 ;;
|
|
*) url=steam://rungameid/$target ;;
|
|
esac
|
|
|
|
if [ "$ui" = desktop ] && [ "${BL_DESKTOP:-}" = 1 ]; then
|
|
case ",${MESA_VK_WSI_DEBUG:-}," in
|
|
*,sw,*) ;;
|
|
*) export MESA_VK_WSI_DEBUG=${MESA_VK_WSI_DEBUG:+$MESA_VK_WSI_DEBUG,}sw ;;
|
|
esac
|
|
if [ "${BL_STEAM_CLIENT_ARCH:-}" = x86_64 ]; then
|
|
client_home=${BL_X64_HOME:-${HOME:-/root}/.droiddeck-x64}
|
|
client=(/usr/local/bin/droiddeck-steam-x64 --exec)
|
|
else
|
|
steam_root=${XDG_DATA_HOME:-${HOME:-/root}/.local/share}/Steam
|
|
export LD_LIBRARY_PATH=$steam_root/steamrtarm64:$steam_root/steamrtarm64/panorama${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
|
client_home=$HOME
|
|
client=("$steam_root/steamrtarm64/steam")
|
|
fi
|
|
if [ "${BL_BOTTOM_DESKTOP:-}" = 1 ]; then
|
|
pid=$(cat "$client_home/.steam/steam.pid" 2>/dev/null || true)
|
|
if [ -p "$client_home/.steam/steam.pipe" ] && [[ "$pid" =~ ^[0-9]+$ ]] && kill -0 "$pid" 2>/dev/null; then
|
|
# The top screen's client takes the request, so games open there.
|
|
exec "${client[@]}" -nobigpicture -no-cef-sandbox \
|
|
-cef-ozone-platform=x11 -cef-disable-gpu "${url:-steam://open/library}"
|
|
fi
|
|
fi
|
|
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/droiddeck"
|
|
exec 9>"${XDG_CACHE_HOME:-$HOME/.cache}/droiddeck/steam-desktop.lock"
|
|
if ! flock -n 9; then
|
|
for ((attempt = 0; attempt < 180; attempt++)); do
|
|
pid=$(cat "$client_home/.steam/steam.pid" 2>/dev/null || true)
|
|
if [ -p "$client_home/.steam/steam.pipe" ] && [[ "$pid" =~ ^[0-9]+$ ]] && kill -0 "$pid" 2>/dev/null; then
|
|
exec "${client[@]}" -nobigpicture -no-cef-sandbox \
|
|
-cef-ozone-platform=x11 -cef-disable-gpu "${url:-steam://open/library}"
|
|
fi
|
|
sleep 0.5
|
|
done
|
|
echo "droiddeck-steam-launch: the desktop client did not become ready" >&2
|
|
exit 69
|
|
fi
|
|
[ "$url" = steam://exit ] && exit 0
|
|
export BL_INSIDE=1 BL_STEAM_UI=desktop
|
|
exec /usr/local/bin/droiddeck-session steam "${url:-steam://open/library}"
|
|
fi
|
|
|
|
dir=${BL_LAUNCH_DIR:-}
|
|
if [ -z "$dir" ] || [ ! -d "$dir" ]; then
|
|
echo "droiddeck-steam-launch: not inside a DroidDeck session (BL_LAUNCH_DIR unset)" >&2
|
|
exit 69
|
|
fi
|
|
printf 'ui=%s\nurl=%s\n' "$ui" "$url" > "$dir/steam-launch.tmp" && mv -f "$dir/steam-launch.tmp" "$dir/steam-launch"
|
|
echo "droiddeck-steam-launch: asked the app for Steam ($ui${url:+, $url})"
|