Need for start up and shutdown user scripts?
-
There exists the need for a Retropie native method to run user scripts on boot and shutdown.
For example, I wrote some scripts to switch my button lights on and off acording to the game being played (rpi-arcade-lights). I can use the
runcommand-onstart.sh
andruncommand-onend.sh
script to change the lights before the game launches and after the game ends. There are two other hooks I need: RetroPie start up and shut down. Without these my lights stay on after the system shuts down and don't switch on after the machine boots. There are ways to achieve what I want, but they are imperfect.So I have seen others advise using the
/opt/retropie/configs/all/autostart.sh
script, but this seems to get rewritten under certain conditions, such as runningretropie_setup.sh
. This is not ideal.It would be really useful if there were a
runcommand-onboot.sh
andruncommand-onshutdown.sh
that were only for user scripts and gauranteed not to be rewritten by RetroPie. -
@rincewind said in Need for start up and shutdown user scripts?:
It would be really useful if there were a
runcommand-onboot.sh
andruncommand-onshutdown.sh
that were only for user scripts and gauranteed not to be rewritten by RetroPie.Runcommand isn't running at those times, but EmulationStation usually is: https://retropie.org.uk/docs/EmulationStation/#scripting
-
@sleve_mcdichael Thanks for that. I didn't know that that existed.
It looks like there is no script for boot up offered by emulation station.
Also more fundametally, would it not make sense to have a frontend agnostic hooks? This may be unneccesary abstraction, but what if the user changes to Attract-Mode, then they would have to write new scripts. RetroPie already offers duplicate hooks i.e.
onstart
andonend
. -
This post is deleted! -
autostart.sh
doesn't get overwritten by running retropie_setup. -
@rincewind said in Need for start up and shutdown user scripts?:
Also more fundametally, would it not make sense to have a frontend agnostic hooks?
No need to reinvent the wheel: Systemd (service type
oneshot
) is most likely your friend.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.