A convenient status and menu to play pianobar in tmux
.
The easiest way to install tmux-pianobar
is via the Tmux Plugin Manager.
-
Add plugin to the list of TPM plugins in
.tmux.conf
:set -g @plugin 'GoHarder/tmux-pianobar'
-
Use prefix–I install
tmux-pianobar
. You should now be ready to connecttmux-pianobar
. -
When you want to update
tmux-pianobar
use prefix–U.
-
Clone the repository
$ git clone https://github.com/tmux-plugins/tmux-pianobar ~/clone/path
-
Add this line to the bottom of
.tmux.conf
run-shell ~/clone/path/yank.tmux
-
Reload the
tmux
environment# type this inside tmux $ tmux source-file ~/.tmux.conf
You should now be ready to connect tmux-pianobar
.
This plugin uses pianobar's events feature to update player information. This is to prevent constant buffer copying.
Inside the pianobar config file there is an option called event_command
insert the location of the plugins events script.
event_command = [your home directory]/.tmux/plugins/pianobar/scripts/radio/scripts/events.sh
In order for tmux-pianobar
to work, you must have pianobar installed.
To view the song information insert #{radio}
inside status right.
st_radio="#[bg=color248#,fg=black]#{radio}"
st_time="#[bg=white,fg=black] %I:%M%p "
st_date="#[bg=color208,fg=black] %m/%d/%Y #[default]"
set -g status-right "$st_radio$st_time$st_date"
Currently the menu is bound to Alt–/. Hopefully in future updates there will be options to rebind this inside the tmux config file
There are plenty of upgrades that can be done to this plugin. There are some pianobar controls that are not inserted into the menu. If you need advanced options currently you can view the feed from the radio menu.
Theres also the option to put the track data in other places than the right status.