You should never “yank” the power cord out of your Pi as this can lead to severe data corruption (and in some cases, physically damage your SD card). Even if BATOCERA is best prepared against file corruption it is recommended to safely shut down your Pi via BATOCERAs Quit Menu or even better, use a power button or switch.
This method gives the best user experience if you use the GPi-case from Retroflag for example. This nice housing only gots one button switch to simply turn on/off the Raspberry. Since BATOCERA 5.25 the OS is best prepared for all kinds of power devices connected to the Raspberry. But you will lose your game SRM state (Battery save) if you just trigger the power button INSIDE a game session.
chmod +x /userdata/system/custom.sh
#!/bin/bash # custom.sh - place to /userdata/system # by cyperghost 23/11/19 # if [[ $1 == stop ]]; then batocera-es-swissknife --emukill fi