Hi,
I installed a button switch and an LED.
The hardware and software are both very simple.
The short push of the button toggles play/pause, and the long push (indicated by the LED) starts shutdown.
The control script is written in shell script, so installation of python or so is not required.
yjo