Dear command line fans, here is my 2 cents, powerline configuration.

All you need is to add these two configuration. They are theme (multiline) and colorscheme. And alter config.json.

I haven’t done anything yet for tmux, and other powerline capabilities.


Screenshot Information
OS: Arch
+ WM: Awesome WM
+ Shell: Fish

Powerline Light: arch+awesome

Powerline Dark: arch+awesome


Reading

Always look at the official documentation first


Installing

Using package management is straightforward.

Arch

$ sudo pacman -S powerline

Manjaro

$ sudo pacman -S powerline

Powerline: Install Arch

Debian

$ sudo apt install powerline

Powerline: Install Debian


Font

You can download manually based on documentation, or use package management above.

Arch/Manjaro

Install Font package

$ sudo pacman -S powerline-fonts

Let’s check.

$ pacman -Ql powerline-fonts
...
... /usr/share/fonts/OTF/PowerlineSymbols.otf

Debian

Font Package automaticaly installed as dependency.

$ dpkg -L fonts-powerline
...
/usr/share/fonts/opentype/PowerlineSymbols.otf

Note: Terminus Font also works.


Shell Prompt

“Where and how can I set the PS1 variable for Powerline bash?”
A good simple question.

The answer is in powerline manual documentation

There is no need to explicitly export PS1 in bash.

Bash

Arch/Manjaro (root/user)

powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh

Debian (root/user)

powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh

Fish

$ cat ~/.config/fish/config.fish 
powerline-daemon -q
set POWERLINE_BASH_CONTINUATION 1
set POWERLINE_BASH_SELECT 1
set fish_function_path $fish_function_path "/usr/lib/python3.5/site-packages/powerline/bindings/fish"
powerline-setup

Here is a summary, with nice powerline-in-vim colour-scheme.

  • Terminal Above: .bashrc only (with ansi color art)

  • Terminal Below: .bashrc with powerline

Powerline: .bashrc ViM


Vim

Arch/Manjaro

No need to alter .vimrc configuration in Arch/Manjaro

$ sudo pacman -S powerline-vim

Debian

Since no official plugin for ViM, whe have to do it with PIP.

$ sudo pip3 install git+git://github.com/Lokaltog/powerline

And insert this line to .viwmrc

set rtp+=/usr/local/lib/python3.5/dist-packages/powerline/bindings/vim
set laststatus=2
set t_Co=256

Reading

Customization

Main Config

Here is the place, you configure which colorscheme and theme you are using.

	"shell": {
		"colorscheme": "epsi",
		"theme": "epsi",
		"local_themes": {
			"continuation": "continuation",
			"select": "select"
		}

Colorschemes

Self Explanatory

  • https://gitlab.com/epsi-rns/dotfiles/blob/master/config/powerline/colorschemes/epsi.json
		"user":      { "fg": "gray2", "bg": "yellow", "attr": ["bold"] },
		"superuser": { "fg": "yellow", "bg": "orange", "attr": ["bold"] },

Theme

It define what widget, ad their position. It is going to be your choice, of what segment you need to show in your shell.

  • https://gitlab.com/epsi-rns/dotfiles/blob/master/config/powerline/themes/shell/epsi.json
	{
		"function": "powerline.segments.common.time.date",
		"name": "time",
		"args": {
			"format": "%H:%M:%S %A",
			"istime": true
		}
	},
	{
		"function": "powerline.segments.common.time.fuzzy_time"
	}

Note that BASH do not support right segment. Right segment is very useful when working with git. I usually switch to FISH, everytime I’m doing git.

You can see the sample in top of this this article.


Happy terminal customizing

Reading: