I just read about this command line Pandora player called pianobar

It works great but the homepage says "last.fm scrobbling (using an external scrobbler)"

Any one ever set this up before?


3 Answers 3

  1. First you'll need an external scrobbler. I recommend scrobbler-helper, which is written in Perl and available via CPAN.

    sudo perl -MCPAN -e 'install Audio::Scrobbler'
  2. Configure pianobar to use external scrobbler.

    Skip the next two steps if you already have a ~/.config/pianobar/config.

    • Create the configuration directory for pianobar,

      mkdir -p ~/.config/pianobar
    • Copy the example config file,

      cp /usr/share/doc/pianobar/contrib/config-example ~/.config/pianobar/config
    • Now in ~/.config/pianobar/config, remove the # from the beginning of this line:

      #event_command = /home/user/.config/pianobar/eventcmd

      and replace user with your actual username. This sets the path of the script that will be run every time you finish playing a song.

    • ~/.config/pianobar/eventcmd doesn't exist yet, so download this script to your Desktop. That script is the same as the one found in /usr/share/doc/pianobar/contrib/eventcmd.sh, but with some lines that required extra packages commented out. Once you have downloaded it, rename it to eventcmd then run the following commands:

      cp ~/Desktop/eventcmd ~/.config/pianobar/eventcmd
      chmod +x ~/.config/pianobar/eventcmd
  3. Configure scrobbler-helper,

    scrobbler-helper needs to know your Last.fm account and password.

    • Create a file ~/.scrobbler-helper.conf and paste the following into it:


      replacing USERNAME and PASSWORD with your actual Last.fm username and password.


Alternative solution: There is a Gtk application called Pithos that is built on libpiano (i.e., it uses the same backend as pianobar). You can set up last.fm scrobbling in the preferences.

Of course, if you prefer a command-line player this doesn't help you very much. But if what you're really looking for is a non-flash, desktop-based Pandora player, this may be perfect for you.


lastfmsubmitd is cool, because it will queue up scrobbles if the network is down.

Copying and pasting the following into bash should get you up and running.

sudo apt-get install pianobar lastfmsubmitd #install requirements
sudo usermod -a G lastfm $USER              #use `lastfmsubmitd` setup group
sudo /etc/init.d/lastfmsubmitd restart      #restart `lastfmsubmitd`
mkdir ~/.config/pianobar                    #setup config environment
cd ~/.config/pianobar
cp /usr/share/doc/pianobar/contrib/eventcmd.sh .
ed eventcmd.sh <<"EOF"                      #Add `lastfmsubmitd` support
                if [ -n "$songDuration" ] &&
                   [ $(echo "scale=4; ($songPlayed/$songDuration*100)>50" | bc) -eq 1 ] &&
                   [ "$rating" -ne 2 ]; then
                        /usr/lib/lastfmsubmitd/lastfmsubmit --artist "$artist" --title "$title" --album "$album" --length "$((songDuration/1000))"
echo "event_command = $HOME/.config/pianobar/eventcmd.sh" >> config

The eventcmd.sh part of the script is from Arnold French

EDIT: You may have to chmod +x eventcmd.sh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.