In this topic, I will show you how to change you terminal style using powerline.
It’s very useful and awesome, I think you would like it.
Let’s check it out.

Install Python & Powerline

  1. Install python

    1
    2
    3
    brew install python
    easy_install pip
    pip install --user powerline-status
  2. Change version

    If the version is python3, change to pip3.

Doesn’t work?
If you have some problem, re-install the powerline-status.

1
2
pip uninstall powerline-status
pip3 uninstall powerline-status

Find powerline direction

Make sure where the python’s powerline direction is.
1st

1
ls {path}/powerline/bindings/bash/powerline.sh

or

2nd

1
. {path}/powerline/bindings/bash/powerline.sh

Note

If first line is works, below is a example, change ls to dot sign.

1
ls /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/powerline/bindings/bash/powerline.sh

change to

1
. /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/powerline/bindings/bash/powerline.sh

Find powerline install Location.

1
pip show powerline-status

there is a line like Location: {path}


Install Fonts

  1. Install fonts

    1
    2
    3
    git clone https://github.com/powerline/fonts.git
    cd fonts
    ./install.sh
  2. Change terminal style

    If you have already installed, you can change your terminal style.
    command + <

If you want to see immediately, change the basic(預設值), if not, you can change whatever you want.

1
終端機->偏好設定->描述檔->(預設值/其他)->文字->字體更改

monofur for powerline (or something u like)

  1. If success, or not

    open new terminal, if so, you will see something special.

Modify .bash_profile

  1. Modify / create

    Modify or create .bash_profile

    1
    2
    touch ./.bash_profile
    open ./.bash_profile
  2. Setting script

    Setting the script to .bash_profile at the bottom.

    1
    2
    3
    if [[ -f /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/powerline/bindings/bash/powerline.sh ]]; then
    . /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/powerline/bindings/bash/powerline.sh
    fi
  3. Install dotfiles

    1
    2
    3
    git clone https://github.com/MilesChou/dotfiles.git
    cd dotfiles/
    cp -r .config/powerline ~/.config/
  4. Check result

If your installation is successful, you can see the terminal become 2 line.

  1. Install bash-completion

    1
    brew install bash-completion
  2. Setting scripts

Setting the “Bash completion for brew” script to .bash_profile at the bottom.

1
2
3
if [[ -f $(brew --prefix)/etc/bash_completion ]]; then
. $(brew --prefix)/etc/bash_completion
fi

It’s also in My GitHub repository.

Welcome to give a star. Thx :)


References

[1] powerlinehttp://wiki.framins.com/#!linux/powerline.md
[2] bash_profilehttps://github.com/MilesChou/dotfiles/blob/master/.bash_profile