Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Hardware Button to select next streaming radio channel
#5
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

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
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
RE: Hardware Button to select next streaming radio channel - by Tim Curtis - 02-11-2022, 10:34 PM

Forum Jump: