Mod your Kintaro NES case with a power LED in the front and a secure soft shutdown on/off button or switch.
This mod uses the Rpi 3 GPIOs 14 (TXD) (Pin 8) and GND (Pin 6) for the LED.
For the button or in my case sliding switch the GPIO 3 (Pin 5) with the built in pull up resistor and GND (Pin 9) is used.
For testing the button on GPIO 3 the test-gpio.sh script could be used directly in a terminal via:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/schlegel11/KintaroNesCaseMod/master/test-gpio.sh)"
If the button gets pressed or switch gets slided you should see the output "Your button works :)" in the terminal.
If you are using retropie you can use the install-shutdown-service.sh script to add a startup service which executes the shutdown command when the button gets pressed or switch slided.
Execute the script directly in terminal as root via:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/schlegel11/KintaroNesCaseMod/master/install-shutdown-service.sh)"
if you are using recalbox, it is even easier, because only one value needs to be commented out in the configuration: