www.pokeroconnor.com

Mac Terminal Themes and Bash Tips

March5

If you’re tired of the usual terminal color schemes and font style, try this great theme. Something that deserves a mention is Ciaran O’Leary’s blog entry on customizing color schemes in Leapord. This is an essential pre-requisite to any color themes you wish to use. You must install SIMBL first, and then extract the theme file to ~/Library/Application Support/SIMBL/Plugins on your machine. In other words, just place the theme.bundle file in your ~/Library/Application Support/SIMBL/Plugins directory, that is all you need to do, then restart terminal and viola.

However, there are some bash changes needed, some of them essential, before these changes will work. For example, you need to create a .bash_profile file (in your ~ directory) if one did not exist before. There are 2 things you need in that file in order to really make use of these themes. A basic .bash_profile would look like so:

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
export CLICOLOR=1;
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'

The if statement just ensures that the contents of your .bashrc file are read. The export CLICOLOR=1; line is essential for the themes to work correctly, for example if you do not include this, doing an ls will not result in any color schemes being rendered. 

The export GREP_OPTIONS line is optional, but one I find very useful, as your grep’s now have the search patterns differentiated in the output, very readable.

This leads on to the .bashrc file, which you should also need to create of none exists. Your aliases should go in this file. Bash aliases are a great way to speed up your work in terminal, from simple stuff like ls shorthands such as alias l=’ls -la’ or alias h=’history’ to more complex ones corresponding to scripts. There’s a tonne of pages about aliases out there of course, here’s just a small taste. I especially like customizing your prompt via PS1, e.g. adding export PS1=”[\u][\h][\#][\w]# “ to your bash_profile file. This would give you a terminal prompt of [user][host][command number][current directory], very useful.

Email will not be published

Website example

Your Comment: