Code: Select all
#!/bin/sh
# play radio streams using dmenu
if [ "$(pidof mpg123)" ] ; then
echo "Stopping $selection ..." | osd_cat -s 0 -S white -c white -p bottom -A center -d 2 -l 1
killall mpg123
exit 0
fi
stations="$(cat /usr/local/share/radiolist)"
selection="$(echo "$stations" | dmenu "[email protected]")"
player() { mpg123 -C [email protected] "[email protected]" 2>/dev/null & }
echo "Playing $selection ..." | osd_cat -s 0 -S white -c white -p bottom -A center -d 5 -l 1 &
player $selection