Using tmux powerline

tmux is a necessary tool for anyone doing work in a terminal. Why not make the experience more aesthetically pleasing? I personally trick out my terminal with powerline. Powerline is a statusline plugin for vim that can be configured to provide statuslines for other applications, including tmux.

what powerline does

Powerline will take a configuration and output a string of characters into the tmux window every few seconds.

The configuration I use displays the local hostname, the time, the date, the system load, uptime, as well as the current playing track in Spotify and time remaining in that track.

Any output that you can obtain from a shell script or otherwise can be incorporated into powerline.

how to install it

First, you'll need to install powerline. It's a python package, so you can install it using pip.

pip install powerline-status

This will install the powerline binary in your path.

❯ which powerline
/usr/local/bin/powerline

Powerline requires a configuration to work - this is provided by a colorscheme, theme, etc. files located in ~/.config/powerline . An example configuration can be found here.

In order for some of the helpful information to be populated in this configuration, some additional packages are needed.

For various system utilities, we'll need psutil .

pip install psutil

To view the currently playing track in Spotify (or other players that support dbus), we'll need dbus-python.

pip install dbus-python

Finally, in order for our tmux configuration to use powerline, we'll need to update the configuration to use powerline-status .

Copy the configuration file found here and source it in your .tmux.conf:

# Powerline
source ~/.tmux.powerline.conf

Reload your tmux configuration, and you're done!

conclusion

Powerline is a simple utility that can provide helpful information while working in the terminal. In addition, it looks cool.