From telent after transferring all scripts need exec set
chmod +777 AttractMode.sh
Check python version installed.
python3 --version
Preinstalled on Pi4 buster.
sudo apt-get install python3-pip
to install python3 package manger
sudo apt install python3-gpiozero
pip3 install evdev
RetroPie\configs\all\emulationstation\es_systems.cfg
<system> <name>scripts</name> <fullname>scripts</fullname> <path>/home/pi/RetroPie/roms/scripts</path> <extension>.sh .SH</extension> <command>%ROM%</command> <platform/> <theme>misc</theme> </system>