Oh-my-zsh and Powerline Fonts setup for Awesome Terminal in Ubuntu 16.04

Step 1: Installing General Requirements

Install Git
sudo apt-get install git
Install Curl
sudo apt-get install curl
Install pip
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7

Features:

  1. It is written in Python language, which makes it extensible and feature rich.
  2. Stable and testable code base, which works well with Python 2.6+ and Python 3.
  3. It also supports prompts and statusline’s in several Linux utilities and tools.
  4. It has configuration and decorator colors developed using JSON.
  5. Fast and lightweight, with daemon support, which provides even better performance.

Step 2: Installing Powerline Tool

pip install git+git://github.com/Lokaltog/powerline

Step 3: Installing Powerline Fonts

Powerline uses special glyphs to show special arrow effect and symbols for developers. For this, you must have a symbol font or a patched font installed on your systems.

Download the most recent version of the symbol font and fontconfig configuration file using following wget commands

wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf

Then you need to move the font to your fonts directory, /usr/share/fonts/ or /usr/local/share/fonts as follows or you can get the valid font paths by using command xset q

sudo mv PowerlineSymbols.otf /usr/share/fonts/

Next, you need to update your system’s font cache as follows.

sudo fc-cache -vf /usr/share/fonts/

Now install the fontconfig file.

sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/

Step 4: Enable Powerline on Bash Shell

To enable Powerline in bash shell by default, you need to add the following snippet to your ~/.bashrc file. (gedit ~/.bashrc)

First get the location of installed powerline using following command.

PowerlinePath

Once you know the actual location of powerline, make sure to replace the location in the below line as per your system suggested.

powerlinebash

Now try to logout and login back again, you will see powerline statuesline as shown below.

BashTerm

Try changing or switching to different directories and keep a eye on “breadcrumb” prompt changes to show your current location.

Step 5: Enable Powerline for Vim

If vim is your favorite editor, luckily there is a powerful plugin for vim, too. To enable this plugin, add these lines to ~/.vimrc file.

for system wide profile: gedit /etc/vim/vimrc

PowerlineVim

Now you can launch vim and see a spiffy new status line:

vim

Step 6: Install zsh and Oh-my-Zsh

To install zsh

sudo apt-get install zsh

To install Oh-my-zsh go to their github page and follow instructions

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Select zsh them. For this you will need to edit the ~/.zshrc file. (gedit ~/.zshrc)

ZSH_THEME="agnoster" # (this is one of the fancy ones)

Save changes and restart terminal and run “zsh”

agnoster

To run zsh as default shell

which zsh   # (check path of zsh)
chsh -s /usr/bin/zsh  #(adjust path according to your path output above

Restart system for the shell to be used as default.

Advertisements

Join the Discussion

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: