Change Terminal style using powerline
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
Install python
1
2
3brew install python
easy_install pip
pip install --user powerline-statusChange version
If the version is python3, change to pip3.
Doesn’t work?
If you have some problem, re-install the powerline-status.
1 | pip 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
Install fonts
1
2
3git clone https://github.com/powerline/fonts.git
cd fonts
./install.shChange 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)
Modify .bash_profile
Modify / create
Modify or create .bash_profile
1
2touch ./.bash_profile
open ./.bash_profileSetting script
Setting the script to .bash_profile at the bottom.
1
2
3if [[ -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
fiInstall dotfiles
1
2
3git clone https://github.com/MilesChou/dotfiles.git
cd dotfiles/
cp -r .config/powerline ~/.config/Check result
If your installation is successful, you can see the terminal become 2 line.
Setting the “Bash completion for brew” script to .bash_profile at the bottom.
1 | if [[ -f $(brew --prefix)/etc/bash_completion ]]; then |
It’s also in My GitHub repository.
Welcome to give a star. Thx :)
References
[1] powerline: http://wiki.framins.com/#!linux/powerline.md
[2] bash_profile: https://github.com/MilesChou/dotfiles/blob/master/.bash_profile