Make your terminal cool

Screen Shot 2014-07-03 at 4.01.45 PM

 

You can achieve this terminal look easily with few quick steps. In my case, I am using iterm2 in osx mavericks along with zsh powered by oh-my-zsh. I do know that its possible in bash too. My recipe does works in Mint, Ubutu too. Not sure of Fedora 😦 .. So lets begin.

Installing zsh and make it default shell

Install zsh using yum, brew or apt-get. In case of ubuntu run :    $sudo apt-get install zsh   . It will  ask for your password and finally it should complete its setup. Then we set zsh as default shell by running : $chsh -s /bin/zsh . To see the effect you have to logout then login. But dont logout now. As running zsh first time ; it asks to setup zshrc file for you. We want to logout after configuring our zshrc first.

Configuring oh-my-zsh

Lets quickly run few more commands. Dont blindly run commands try to understand each command .

$git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
$mkdir -p ~/.bin/dotfiles/zsh/
$cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.bin/dotfiles/zsh/zshrc
$ln -s ~/.bin/dotfiles/zsh/zshrc  ~/.zshrc

By running all this we are setting our default zshrc file. Now you can logout and login again to find zsh as your default shell.

Installing ducknorris theme and Powerline fonts

You are so close. We have to configure ducknorris theme and powerline fonts. Download powerline fonts from here and configure one of the fonts in your terminal profile preference. Then create ducknorris.zsh-theme file inside ~/.bin/dotfiles/zsh/ducknorris.zsh-theme  .  Copy the theme content from that website and paste it into the file. Now run following command :

$ln -s ~/.bin/dotfiles/zsh/ducknorris.zsh-theme ~/.oh-my-zsh/themes/

Edit ~/.bin/dotfiles/zsh/zshrc file and change replace ZSH_THEME setting to following :

ZSH_THEME="ducknorris"

POWERLINE_DETECT_SSH="true"
POWERLINE_GIT_CLEAN="✔"
POWERLINE_GIT_DIRTY="✘"
POWERLINE_GIT_ADDED="%F{green}✚%F{black}"
POWERLINE_GIT_MODIFIED="%F{blue}✹%F{black}"
POWERLINE_GIT_DELETED="%F{red}✖%F{black}"
POWERLINE_GIT_UNTRACKED="%F{yellow}✭%F{black}"
POWERLINE_GIT_RENAMED="➜"
POWERLINE_GIT_UNMERGED="═"
POWERLINE_HIDE_HOST_NAME="true"
POWERLINE_RIGHT_A="exit-status"

 

Reopen terminal to see your cool new terminal look. I usually keep all my dotfiles inside ~/.bin/dotfiles and sync them to a private repository in bitbucket. You can do that too. Have Fun !!

Advertisements