I like to listen to Pandora while in my car, at work, even while playing video games. One thing I really dislike about Pandora is the flash player interface. You can use an HTML5 version but that is still dependent on a browser window to be open. What I wanted to do is run Pandora from a terminal command, that way I could detach and literally have no user interface. With Pianobar this is possible.
Requirements
I'm going to cover OS X Lion and Snow Leopard since these are the two operating systems I use at work and at home. If you're running Linux or Windows I can't really help you. To get started you're going to need some development tools.
Snow Leopard: Xcode
Lion: Command Line Tools for Xcode
If you're running Lion you can get away with the Command Line Tools. This is nice because it installs the minimum requirements to install Pianobar. Because it isn't a full blown install of Xcode the file size is much smaller (163MB). For Snow Leopard you need to install Xcode which is around 1.7GB. You can download these here: https://developer.apple.com/downloads/index.action
Homebrew
Pianobar is cross platform and runs on just about anything. You can install it the hard way by getting all of the dependencies, or you can use something like MacPorts or Homebrew to install it in a single command. I like Homebrew so my guide is going to cover it over MacPorts. To install Homebrew enter the following command (only after installing Xcode or the Command Line Tools):
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
That was easy.
Installing Pianobar
Once you have Homebrew installed installing Pianobar is a breeze. The command couldn't be easier:
brew install pianobar
Instalation took about 10 minutes on my MacBook Air. Not exactly speedy but much faster than building Pianobar from source and making sure I have all the dependencies installed. Next we need to configure your login information. By default Pianobar is installed in "/usr/local/Cellar/pianobar". Inside of that folder will be the build version. Inside that is a contrib folder which has the sample config file. Uncomment the username and password portion and enter your username and password. Save the file as "config". Pianobar looks for this file in ~/.config/pianobar/ so you'll need to create those folders. Place the config folder in ~/.config/pianobar/ and you won't have to enter your username and password on startup.
Using Pianobar
I like to launch Pianobar in a screen session. This way I can easily detach and return to change settings, like or dislike songs, or stop playback. Pianobar is very intuitive. Simply select a station by typing in the corresponding number and hitting enter. It will immediately start playing that station. Then you can type a question mark to get all of the available commands. The shortcuts are very simple. These are the commands I use the most:
+ love song
- ban song
n next song
b bookmark song
p pause
q quit
( increase volume
) decrease volume
This is a lot of work
You're right, this took about 20 minutes of my time to setup but in the end it saves me a bunch of hassle worrying about that browser window as well as the advertisements flashing to get my attention. Plus, what's life without whimsy?



