02-11-2022, 10:34 PM
I forgot to mention that if you have multiple commands to execute they will need to be placed in a script. The CMD field in the button handler should contain the absolute path to the script. In the example below that path would be /home/pi/myscript.sh
Example
Example
Code:
# Open the nano editor
sudo nano /home/pi/myscript.sh
# Enter the text below
#!/bin/bash
mpc stop
mpc clear
mpc load MyPlaylist
mpc play
# Save the file
Ctrl-x Y return
# Mark the script executable
sudo chmod +x /home/pi/myscript.sh