Files
libretro/ports/batocera/RetroBIOS.sh
T
Abdessamad Derraz 5db889f538 fix: end handheld runs that lose their input
Start + Select now kills a sentinel the launcher owns, and the launcher
asks the interface to stop, so a running install still writes its result.
A mapper that dies, a chvt the compositor refuses, a terminal app that
cannot open and a read-only card each end the run or hand over to the
next route instead of a console waiting for a button. muOS starts
gptokeyb2 with -X and keeps muxterm off the pad so Y opens the options.
2026-10-23 18:21:45 +02:00

42 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# RetroBIOS for Batocera and Knulli, started from Ports: checks the BIOS
# folder and downloads the files it lacks, in the installer's full-screen
# interface. Batocera gives the controller the keys of RetroBIOS.sh.keys
# (evmapy) while this runs.
#
# The interface needs a terminal the player can see, and EmulationStation
# covers the console. In order: xterm or foot in the graphical session, else
# console 4 switched to and back from. Console 4 because Batocera's exit
# hotkey sends Alt+F4 (batocera_launch emulators/sh.py), which on a console
# switches to console 4: there it leaves the interface where it is.
HERE="$(cd "$(dirname "$0")" && pwd)"
RB_DIR="$HERE/retrobios"
RB_ROUTES="app vt"
RB_VT_SWITCH="${RB_VT_SWITCH:-4}"
RB_PACK_PATH="$RB_DIR:$HERE:/userdata"
RB_LOG="$RB_DIR/log.txt"
# The X11 builds start EmulationStation on display :0, which a script run
# from it does not always inherit, with the cookie S31emulationstation
# exports: xterm is refused the display without it.
if [ -z "${DISPLAY:-}" ] && [ -z "${WAYLAND_DISPLAY:-}" ] \
&& [ -S "${RB_X_SOCKET:-/tmp/.X11-unix/X0}" ]; then
export DISPLAY=:0
fi
RB_XAUTH="${RB_XAUTH:-/var/lib/.Xauthority}"
if [ -n "${DISPLAY:-}" ] && [ -z "${XAUTHORITY:-}" ] && [ -f "$RB_XAUTH" ]; then
export XAUTHORITY="$RB_XAUTH"
fi
# shellcheck source=../shared/tui.txt
source "$RB_DIR/tui.txt"
rb_open_log fresh
rb_select_python
# A launcher's own arguments are not install.py's (muOS passes the app folder).
# shellcheck disable=SC2119
rb_launch
status=$?
rb_release_python
exit $status