Page 1 of 1

Script to play a radio if nothing else is playing in mpc?

PostPosted: 15 Mar 2021, 08:47
by SuttonWillow
I'm trying to achieve this: when I boot up, I'd like to start playing this station I have already added that to `Webradio/MyNoise-PureNature.pls`. Once it's playing, if I start playing some music it should obviously stop, but here is the tricky part, when I stop the music and nothing else is playing, I'd like to start playing that radio again, so it becomes some sort of background sound whenever system is up and nothing is playing. Now, I guess it should be pretty easy to add it at startup through systemd,omegle xender but I have no idea how could I create a bash script with a conditional "if nothing else is playing in mpc, then play .pls". I think it'd be a nice thing to have, but no idea how to go about it. Anyone knows how to create such script.