mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
bannerlator-desktop-games writes one menu entry per installed game (both libraries, the client's own artwork) and links Steam Games / SD Games in the home folder. The entries, and the menu's Steam / Big Picture ones, run bannerlator-steam-launch: the client cannot draw on the desktop (labwc, no dma-buf), so it leaves a request in the session directory; the service watches it (FileObserver), ends the desktop session and hands the activity a Steam session to start - desktop UI (BL_STEAM_UI=desktop drops -gamepadui) with the game's rungameid URL.
29 lines
1.4 KiB
Bash
Executable File
29 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Asks the app to start the Steam client, from inside a session (the desktop's menu entries and
|
|
# the per-game launchers bannerlator-desktop-games writes):
|
|
# bannerlator-steam-launch desktop [appid|steam-url] Steam's desktop UI, optionally a game
|
|
# bannerlator-steam-launch bigpicture [appid|steam-url] Big Picture
|
|
# The client cannot run on the desktop: labwc composites in software and offers no dma-buf, so a
|
|
# game (or the client's own Vulkan window) would die at its first frame. It runs under gamescope,
|
|
# which is a session of its own - so this writes a request into the directory the app watches,
|
|
# and the app ends the desktop session and starts a Steam session in its place.
|
|
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
|
|
dir=${BL_LAUNCH_DIR:-}
|
|
if [ -z "$dir" ] || [ ! -d "$dir" ]; then
|
|
echo "bannerlator-steam-launch: not inside a SteamDeck session (BL_LAUNCH_DIR unset)" >&2
|
|
exit 69
|
|
fi
|
|
# Written whole, then renamed: the app reads it on close, never half-written.
|
|
printf 'ui=%s\nurl=%s\n' "$ui" "$url" > "$dir/steam-launch.tmp" && mv -f "$dir/steam-launch.tmp" "$dir/steam-launch"
|
|
echo "bannerlator-steam-launch: asked the app for Steam ($ui${url:+, $url})"
|