TheMiniCakeTV I've no XU4 with external display available but your method got the disadvantage that it "patches" the emulatorlauncher.py
We can do it much better as BATOCERA is envolving in a more flexible manner. We have the oppurtunity for launching scripts at the start and at the end of an emulator call.
Moreover your "install guide" can be shortend to
wget -O - http://theminicaketv.free.fr/OGST/install-ogst-batocera.sh | bash
With the custom scripts you avoid this whole part
# restore emulatorlauncher.py backup if exists
if [ -f /usr/lib/python2.7/site-packages/configgen/emulatorlauncher.py.bak ]; then
cp -f /usr/lib/python2.7/site-packages/configgen/emulatorlauncher.py.bak /usr/lib/python2.7/site-packages/configgen/emulatorlauncher.py
rm -f /usr/lib/python2.7/site-packages/configgen/emulatorlauncher.py.bak
fi
# patch emulatorlauncher.py making a bakup
search="\ \ \ \ \ \ \ \ # run the emulator"
insert=$'\ \ \ \ \ \ \ \ subprocess.Popen(["test -e \'/userdata/system/custom.sh\' && /userdata/system/custom.sh %s"%system.name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # load tft logo'
sed -i.bak -e "/$search/i $insert" /usr/lib/python2.7/site-packages/configgen/emulatorlauncher.py
# recompil emulatorlauncher.py
python -c "import py_compile; py_compile.compile('/usr/lib/python2.7/site-packages/configgen/emulatorlauncher.py')"
and the script you place in /userdata/system/scripts/
would just be a call like
this example of the calling script
#!/bin/bash
[[ $1 == "gameStart" ]] && /userdata/system/custom.sh $2
[[ $1 == "gameStop" ]] && /userdata/system/custom.sh default