control-pianobar

A pair of scripts that interact with pianobar entirely through notification bubbles and hotkeys.
No terminal necessary!

Download Link

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.

What's Pianobar?

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.

Requirements

Usage

  1. Download either the ZIP File or the TAR Ball.
  2. Place all contents directly inside your pianobar config folder.
    This defaults to $XDG_CONFIG_HOME/pianobar, which is usually $HOME/.config/pianobar.

    mv control-pianobar.tar ~/.config/pianobar/
    cd ~/.config/pianobar/
    tar xf control-pianobar.tar
    
  3. Add the line
    event_command = /FULL/PATH/pianobar-notify.sh
    to your pianobar config file.
    /FULL/PATH/ is where you extracted the files (probably /home/USER/.config/pianobar).
  4. Make sure boths scripts are marked as executable.

  5. 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 on, pressing Media Play/Pause pauses and resumes the music.

The control-pianobar.sh script takes many different arguments. You should bind each argument to a different media key (or just a hotkey). Running control-pianobar.sh with no arguments prints instructions on usage with the following examples.

Bind this key => To this command:

Notes

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.

Author and Contributors