LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Debian, This That and the Other
User Name
Password

Notices


Over several years of using Linux distros (Debian happens to be my fave) and BSDs for my primary computing, I've picked up the odd piece of useful info.
Rate this Entry

Online Radio Fun

Posted 11-04-2009 at 07:05 PM by ofaring
Updated 04-19-2010 at 03:38 PM by ofaring (slight update)

In the spirit of old hardware and minimalism I've set up my fave radio stations in a little bash script. Perhaps not the most elegant solution, but it works for me. Especially since I employ Debian Multimedia's mplayer-nogui package.

Code:
#!/bin/sh
#
# This is my online radio station list/script. Simple and relatively easy
# to use, it gets the job done without an irritating GUI.
#
# Electronica #
OPTIONS="--Electronica--- DI.Trance Proton.Radio Bassdrive"
# Chillout & Ambient #
OPTIONS="${OPTIONS} --Chill--- DI.Chillout Groove.Salad Lush.SomaFM Secret.Agent"
# Alternative #
OPTIONS="${OPTIONS} --Alternative--- Radio.Paradise Rainydawg Soundpool Trondheim"
# Misc. #
OPTIONS="${OPTIONS} --Misc--- Mostly.Classical Quit"
# ----- #
select opt in $OPTIONS; do
	if [ "$opt" = "DI.Trance" ]; then
		mplayer http://scfire-dtc-aa01.stream.aol.com:80/stream/1003 # http://di.fm/mp3/trance.pls #
  			exit
	elif [ "$opt" = "Proton.Radio" ]; then
        	mplayer http://scfire-ntc-aa03.stream.aol.com:80/stream/1041 # http://protonradio.com/proton.m3u #
  			exit
	elif [ "$opt" = "Bassdrive" ]; then
        	mplayer http://aol.streams.bassdrive.com:8008 # http://www.bassdrive.com/v2/streams/BassDrive.m3u #
  			exit
### ---------------------------------- ###
	elif [ "$opt" = "DI.Chillout" ]; then
        	mplayer http://scfire-ntc-aa01.stream.aol.com:80/stream/1035 # http://di.fm/mp3/chillout.pls #
        		exit
	elif [ "$opt" = "Groove.Salad" ]; then
        	mplayer http://streamer-ntc-aa04.somafm.com:80/stream/1018 # http://www.somafm.com/groovesalad.pls #
        		exit
	elif [ "$opt" = "Lush.SomaFM" ]; then
        	mplayer http://streamer-ntc-aa01.somafm.com:80/stream/1073 # http://somafm.com/lush.pls #
        		exit
	elif [ "$opt" = "Secret.Agent" ]; then
        	mplayer http://streamer-dtc-aa03.somafm.com:80/stream/1021 # http://somafm.com/secretagent.pls #
        		exit
### -------------------------------- ###
	elif [ "$opt" = "Radio.Paradise" ]; then
        	mplayer http://scfire-ntc-aa04.stream.aol.com:80/stream/1048 # http://www.radioparadise.com/musiclinks/rp_128.m3u #
        		exit
		# --- RainyDawg kicks ass! --- #
	elif [ "$opt" = "Rainydawg" ]; then
		mplayer http://stream.rainydawg.org:8000/high # http://servers.internet-radio.org.uk/tools/playlistgenerator/?u=http://stream.rainydawg.org:8000/high.m3u&t=.pls
			exit
	elif [ "$opt" = "Soundpool" ]; then
		mplayer http://stream.laut.fm:80/soundpool # playlist acquired from: http://www.internet-radio.org.uk
			exit
	elif [ "$opt" = "Trondheim" ]; then
		mplayer http://scream-ng.uninett.no:8000/mp3 # http://servers.internet-radio.org.uk/tools/playlistgenerator/?u=http://213.158.249.77:8000/r1t.m3u&t=.pls
			exit
### -------------------------------- ###
	elif [ "$opt" = "Mostly.Classical" ]; then
        	mplayer http://scfire-mtc-aa02.stream.aol.com:80/stream/1006 # http://www.sky.fm/mp3/classical.pls #
        		exit
### ---------------------- ###
	elif [ "$opt" = "Quit" ]; then
		echo 'I WILL see you later...!'
  			exit
	else
		echo "Uh, you like, better try again, Man. Or somethin'."
fi
done
The usual rules apply. Copy/paste it as (really, whatever you like) "Radio.sh". Move it to your preferred location. Chmod 777 it, or change the ownership to your regular user and chmod 700 it. Giv'r. E.G.:
Code:
# mv Radio.sh /opt/bin
# chmod 777 Radio.sh
% Radio.sh
Or simply put it somewhere safe, and:
Code:
% cd your_save_location
% chmod 700
% ./Radio.sh
Obviously you are better off with a console version of mplayer or something similar. I used mpg123 for quite a while, but I find mplayer more robust.

One of the reasons I appreciate Debian is its flexibility. When I install KDE or GNOME software through apt-get, I can verify that I'm getting the bare minimum of dependencies required to run that program. Awesome. Especially when you know that my Linux fun began with fat distros like (at the time called) Mandrake and Suse. I may still respect their efforts, but their newest versions would barely run on my old hardware today. No diss intended, but this flexibility even beats Slackware.

Remember that I run old hardware.

I could pick through the KDE sources and build minimal versions of KDE and Qt to run the KDE programs which I use. Of course the build takes f-o-r-e-v-e-r. (Intel never intended a 400MHz Celeron processor with 192Mb of RAM to compile bloated modern software.) And then I have to hope that everything is kosher, 'cause I ain't in the mood to spend three days just supplying dependencies for, let's say, the Opera web browser. (Version 10 kicks ass, by the way. It seems to have solved stability issues which version 9 had introduced.)

So, the fact that I'm able to choose between the normal mplayer install with a gui included and a version without the gui - 'cause I never use it anyway - is very Debian-minimalist like.
Posted in Examples
Views 3739 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 05:31 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration