PowerLineでShellの見た目を変更しよう!
-
MacOS Xのターミナル大好きな人で、ただ、ただ、格好良さを追求したい人向け。
-
完成予想図
Mac OS Xの場合
1 こちらからフォントをダウンロードし、ターミナルの設定で、フォントをSource Code Pro for Powerlineにします。
mkdir ~/powerline
cd ~/powerline
git clone https://github.com/powerline/fonts
cd fonts
bash install.sh
==Source Code Pro for Powerline以外を選択すると文字化けするので注意!==
2 powerline-shellをインストールします。
cd
git clone https://github.com/milkbikis/powerline-shell
cd ./powerline-shell
./install.py
ln -s ~/powerline-shell/powerline-shell.py ~/powerline-shell.py
3 .bash_profileに下記を追記します。
function _update_ps1() {
export PS1="$(~/powerline-shell.py $? 2> /dev/null)"
}
export PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
4 source .bash_profileを実行します。
source ~/.bash_profile
Cent OS 6.6の場合
cd
# pypyをインストールします。
sudo yum -y --enablerepo=epel,rpmforge,remi search pypy
sudo yum -y --enablerepo=epel,rpmforge,remi info pypy
sudo yum -y --enablerepo=epel install pypy
sudo yum -y --enablerepo=epel install pypy-devel
sudo easy_install-2.6 argparse
# pythonのパッケージ管理ソフトpipをインストールします。
sudo curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
# pipを用いて、powerline本体をインストールします。
pip install powerline-status
# フォントをインストールします。
wget "https://github.com/powerline/fonts/archive/master.zip"
unzip master.zip
fonts-master/install.sh