mplayer "http://ice3.somafm.com/spacestation-32-aac" | stdbuf -o L grep "^ICY Info: StreamTitle=" | while read line; do stream=`echo $line | cut -d\' -f2`; len=$((`echo $stream | wc -c`+4)); Xdialog --infobox "$stream" 5 $len 10000; done
A few days ago, I used this shell one-liner to listen to Space Station Soma, and whenever the stream switched to a new tune, pop up a window showing what it was.
Instead of popping up randomly, I wanted to flesh it out so I could call up a pop-up whenever.
Anyway, back to streams & pop-ups, I fleshed it out into two shellscripts & commented the heck out of them.
I listen to radio streams at work with one script, $HOME/bin/radio: https://pastebin.com/rPsrKP94
And find out what's playing with another, $HOME/bin/radio-xsonginfo: https://pastebin.com/DHx7TraQ