control-pianobar is a pair of bash scripts
that interact with pianobar for you.
The point here is that once you set your bindings as described on Usage you'll be able to interact with pianobar without having focus the terminal it's running in, which distracts you and switches focus away from what you're doing.
It's basically a full-of-features terminal client for Pandora.
Quoting its web page:
Pianobar is a free/open-source, console-based client for the personalized online radio Pandora.
zenity(available in most package repositories);
notify-sendcommand (included with most distros). In Ubuntu that's the
libnotify-binpackage (but read the NOTES section below for a better alternative);
pianobarsomewhere in your
$PATH. If it's not in your
$pianobarvariable inside the
Place all contents directly inside your pianobar config
This defaults to
$XDG_CONFIG_HOME/pianobar, which is usually
mv control-pianobar.tar ~/.config/pianobar/ cd ~/.config/pianobar/ tar xf control-pianobar.tar
event_command = /FULL/PATH/pianobar-notify.sh
/FULL/PATH/is where you extracted the files (probably
Make sure boths scripts are marked as executable.
Using your desktop environment, bind different hotkeys to calling
control-pianobar.sh <argument> with different arguments.
For example, bind
Media Play/Pause to
$HOME/.config/pianobar/control-pianobar.sh p. Now whenever you press
Media Play/Pause pianobar will start in the background. If you have
a default station set, the script just starts playing, otherwise it
automatically ask you (with a popup) which station you want. From now
Media Play/Pause pauses and resumes the music.
control-pianobar.sh script takes many different arguments. You
should bind each argument to a different media key (or just a
control-pianobar.sh with no arguments prints
instructions on usage with the following examples.
Bind this key => To this command:
As of this writting
libnotify-bin provides a buggy version of the
notify-send command in Ubuntu, so some options of the command don't
work. On Ubuntu, it is recommended that you install some patched
version of the package that fixes the bug. Without this fix, you might
not get album art, and all your notification will have the same
duration of 10 seconds, which gets annoying fast.
From the date of this writting (2012) I am using a patched version found in the ppa:leolik/leolik. I take no responsibility regarding the contents of this ppa, I'm simply stating it's the one I used.