@Rens I think you're asking what parameters are passed to the onstart/onend scripts. It is just the four mentioned in the docs: $1 = system, $2 = emulator, $3 = rom path and $4 = command
https://retropie.org.uk/docs/Runcommand/#runcommand-scripts
Useful data are passed as arguments to these scripts:
$1 - the system (eg: atari2600, nes, snes, megadrive, fba, etc).
$2 - the emulator (eg: lr-stella, lr-fceumm, lr-picodrive, pifba, etc).
$3 - the full path to the rom file.
$4 - the full command line used to launch the emulator.
You can see here, for example, the runcommand-onstart.sh and others are called with the user_script function:
user_script "runcommand-onstart.sh"
The function:
https://github.com/RetroPie/RetroPie-Setup/blob/cdb2bda29fab4cae57ca5bf283f87620ab4be851/scriptmodules/supplementary/runcommand/runcommand.sh#L1300
# calls script with parameters SYSTEM, EMULATOR, ROM, and commandline
function user_script() {
local script="$CONFIGDIR/all/$1"
if [[ -f "$script" ]]; then
bash "$script" "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" </dev/tty 2>>"$LOG"
fi
}
The meat is here:
bash "$script" "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" </dev/tty 2>>"$LOG"
As you can see, only the four parameters "$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND" are passed to $script