#Things to know before reading
Powerline will replace your statusline formatting settings with its own. You will need to modify Powerline's default theme to replicate your settings and match whatever display and font settings you had before.
Also, you may need to edit some font files if you want to use a specific font with your terminal. Bear that in mind. As it is a beta, it remains a work in progress and information for this application at this time is a little harder to come by.
#Introduction
Powerline is a font set and command-line program addon that beautifies the terminal, giving it a breadcrumbs-like appearance and making certain things in the terminal look more distinctive. In the past, you had to use pip with git to install all the files you needed to make Powerline functional, but nowdays all you need is one command;
sudo apt-get install powerline
With that, the program and fonts are installed. But if you run your terminal now, you won't know it's working because it's not invoked. To invoke it on terminal load, the following needs to be in the respective files;
#Enabling Powerline
Shell: Bourne Again shell (usually ~/.bashrc
)
# Powerline
if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then
source /usr/share/powerline/bindings/bash/powerline.sh
fi
Shell: Z-shell (usually ~/.zshrc
)
# Powerline
if [[ -r /usr/share/powerline/bindings/zsh/powerline.zsh ]]; then
source /usr/share/powerline/bindings/zsh/powerline.zsh
fi
Editor: Vim (usually ~/.vimrc
)
" Powerline
set rtp+=/usr/share/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256
Command-line: tmux (usually ~/.tmux.conf
)
# Powerline
source /usr.share/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"
Other programs are supported, but examples are not detailed herein for brevity. The other programs are:
Awesome Window Manager
i3 Window Manager
Qtile Window manager
TENEX C Shell (tcsh)
Apple / Friendly Interactive Shell (fish)
#Font stuff
Powerline requires modified fonts in order to use it without the embellishments it provides looking super-janky. Previously, I made it seem like there were no fonts at all which work with Powershell, but its author had released a multitude of fonts. Below is the old way I illustrated, just in case you still don't want to install Git and have these fonts only available to you:
#The author misspelled these. I fixed that, While it does not matter, I fixed it anyway.
mkdir -p ~/.fonts
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline.ttf -O ~/.fonts/Liberation\ Mono\ Powerline.ttf
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold.ttf
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Italic.ttf
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold\ Italic.ttf
fc-cache -vf ~/.fonts
The above will install for yourself Liberation Mono for Powerline. If instead you wanted more fonts, you can repurpose the above for the other fonts in the author's git repo for Powerline fonts, or you can do the following;
sudo apt-get install git #Just in case you didn't have it.
mkdir ~/git && cd ~/git #Optional; it's good practice to keep your git stuff organized. Make this whatever you wish.
mkdir ~/powerline && cd ~/powerline #Optional; because the git clone command below just clones a directory named "fonts".
git clone https://github.com/powerline/fonts.git #Paste this address in your browser to go to repo.
cd fonts && sh ./install.sh #See stuff below about this file
If you still want to install these fonts for yourself only, then edit install.sh to make font_dir $HOME/.fonts
. Else, just run the script as-is.
#Issues
Bear in mind, you can still do the long way as presented in the Ubuntu Answers post I sourced from to present the code above, but that is an absolute pain in the butt to deal with, and Powerline hasn't really change in a major way for a long while. Also, I always managed to break Powerline doing it the long way, but after installing the powerline
package all my issues were resolved... at least until I tampered with ~/.profile
. While going against the grain of these "As quickly as possible" threads, I'd still like to try the long method as there are some files in Kim Silkebækken's repositories that had been updated as soon as 6 days ago, from time of this writing.
Another issue is lack of other program support. I can see this being as useful in Nano as it is in Vim, and maybe using this to enhance apt-get, dd, rsync etc.. Nonetheless, the above works because I tested it, at least, as far as getting it working in bash. If there is a problem and it was my fault entirely, whine about it here and I might try some things out, taking your suggestions in mind.
#Information sources
http://www.jupiterbroadcasting.com/98566 (Forward to where they begin to demo Aprecity OS, where I first heard of Powerline)
http://askubuntu.com/questions/283908/how-can-i-install-and-use-powerline-plugin