Monday, 20 May 2013

Customizing linux terminal with powerline (powerline-shell)

Borded of how your terminal looks?
In the past I used to edit the bash superglobal $PS1 to make it look a littile better.
I found this awesome thing called powerline-shell on github which makes your terminal look so awesome. Not only it makes your terminal look beautiful it also helps us to visualize many things easily. Like errors, git stuff..etc
I took some time and modified it a little. Here is mine:

Download

How to get it?


  1.  Download powerline-bash.py from the link and place it in the home folder.
  2. Make it executable

    chmod +x ~/powerline-bash.py
  3. Then add the following lines to the file ~/.bashrc:
    function _update_ps1() {    export PS1="$(~/powerline-bash.py $?) " } export PROMPT_COMMAND="_update_ps1"
  4. Now patch the font. Download anonymous Pro-Powerline.ttf and open it to install it
  5. You are done!!! Now just open the terminal.


NOTE: If it doesn't work properly and prints some garbage elements then u have to patch the font you are using for your terminal from here

6 comments:

  1. bash: /home/user/powerline-bash.py: Permission denied

    whenever i open my terminal this is being displayed..

    ReplyDelete
    Replies
    1. This detailed installation guide may help: http://reversiblean-reversiblean.rhcloud.com/install-vim-powerline/

      Delete
    2. Thanks for sharing the wonderful article :)

      Delete
    3. NP Suresh! BTW if you use Powerline only in Vim, I'd recommend VimAirline.

      Delete
  2. That is because powerline-bash.py is not executable. Do this to make it executable:
    chmod +x ~/powerline-bash.py
    Anyways I have updated the post. :)

    ReplyDelete