A pair of scripts that interact with pianobar entirely through notification bubbles and hotkeys.
No terminal necessary!
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.
bash
(obviously);zenity
(available in most package repositories);notify-send
command (included with
most distros). In Ubuntu that's the libnotify-bin
package (but read
the NOTES section below for a better alternative);pianobar
somewhere in your $PATH
. If it's not in your $PATH
edit
the $pianobar
variable inside the control-pianobar.sh
script.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
event_command = /FULL/PATH/pianobar-notify.sh
/FULL/PATH/
is where you extracted the files (probably /home/USER/.config/pianobar
).
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
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:
control-pianobar.sh p;
control-pianobar.sh quit;
control-pianobar.sh history;
control-pianobar.sh next;
control-pianobar.sh previousstation;
control-pianobar.sh nextstation;
control-pianobar.sh love;
control-pianobar.sh ban;
control-pianobar.sh explain;
control-pianobar.sh switchstation;
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.