Skip to content
Jabran Rafique

Dev workspace setup on Linux (Ubuntu) with Terminator, Oh My ZSH and Cobalt2

3 minutes read

I recently joined Rated People as a frontend web developer, which moved me from OS X to Linux. I now spend most of the day on an office PC running Ubuntu 14.04 LTS instead of my own MacBook Pro, so one of the first jobs was to set it up like my machine at home.

Mathew White, a senior developer on the team, recommended Terminator. It replaces the default Terminal app, much like iTerm2 does on OS X.

Terminator

Source: Gnome Terminator

Next I wanted to liven up Terminator's default UI, which I find a bit dull. That meant switching the shell from Bash to ZSH and customising it with Oh My ZSH. I also wanted to keep using the Cobalt2 colours by Wesbos, but there was no official version for Terminator. A quick search turned up Mark Badolato's Cobalt2 config file for Terminator. After that it was just a matter of putting the pieces together. Here are the steps I followed on Ubuntu 14.04 LTS. At the end your shell should look something like this.

Terminator on Ubuntu 14.04 LTS with Cobalt2 and Oh My ZSH

Installation

Install Terminator (Official guidelines):

$ sudo apt-get install terminator

Open Terminator and install ZSH shell:

$ sudo apt-get install zsh

Check where ZSH is installed:

$ which zsh

It should print the path to ZSH, e.g. /usr/bin/zsh.

Switch to ZSH:

$ chsh

Enter your admin password, then the path to ZSH from the previous step, e.g. /usr/bin/zsh.

If you're a network user, or you see chsh: user '...' does not exist in /etc/passwd, this method may not work. Instead, add the path to ZSH to the .profile file in your home directory. Open it in an editor:

$ nano ~/.profile

Add these two lines at the end:

...
# Use ZSH as default shell
/usr/bin/zsh

Save with CTRL x and confirm the changes and filename if asked. Restart Terminator. You'll now see a tilde ~ instead of the usual prompt, which means ZSH starts when the app does. You can also check with $ echo $0, which prints the current shell, e.g. /usr/bin/zsh.

Now install Oh My ZSH (OMZ). Paste one of these commands into Terminator and hit enter to download and install it.

Using cURL:

$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Using wget:

$ sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

When it's done, OMZ prints a funky success message. Next, install the Cobalt2 theme for OMZ. Open Wesbos's Cobalt2 theme for iTerm2 in your browser and copy all of it. Then create a new OMZ theme file in Terminator:

$ nano ~/.oh-my-zsh/themes/cobalt2.zsh-theme

Paste it in (Ctrl Shift v) and save (Ctrl x). Cobalt2 needs the Powerline fonts to display properly. Download the Powerline fonts repo:

$ cd  ~/
$ wget -O powerline-fonts.zip https://github.com/powerline/fonts/archive/master.zip

Unzip it:

$ unzip powerline-fonts.zip

Install Powerline fonts:

$ bash ./powerline-fonts/install.sh

Remove the installation files:

$ rm -rf powerline-fonts
$ rm powerline-fonts.zip

The last steps are setting the Cobalt2 colour profile and, if you like, customising the prompt. There's no official colour profile for Terminator, so use the one by Mark Badolato. Copy this:

[[Cobalt2]]
    palette = "#000000:#ff0000:#38de21:#ffe50a:#1460d2:#ff005d:#00bbbb:#bbbbbb:#555555:#f40e17:#3bd01d:#edc809:#5555ff:#ff55ff:#6ae3fa:#ffffff"
    background_color = "#132738"
    cursor_color = "#f0cc09"
    foreground_color = "#ffffff"
    background_image = None

Open the Terminator config file:

$ nano ~/.config/terminator/config

Paste it (Ctrl Shift v) just below the [[default]] block, indented with spaces to match. Save (Ctrl x) and confirm the changes and filename to exit. Restart Terminator, right click anywhere in it and choose Preferences. On the Profiles tab, select Cobalt2. Terminator on Ubuntu 14.04 LTS is now running the Cobalt2 theme.

Extra: you can change the prompt too. I swapped the default cross for a heart. To do that, edit the Cobalt2 theme file.

$ nano ~/.oh-my-zsh/themes/cobalt2.zsh-theme

Enjoy your new, much better looking command line.