My bash profile

8 August, 2012 § 1 Comment

While working on Firefox you end up using the terminal a lot. The most common things I do with my terminal are to perform an incremental rebuild of Firefox and to run Firefox :)

Here’s the relevant portion of my bash profile:

alias beep='echo -en "\007"'
alias beep2='beep && beep'
alias beep4='beep2 && beep2'
alias beep8='beep4 && beep4'
alias beep16='beep8 && beep8'
alias beep32='beep16 && beep16'
alias fx='dist/bin/firefox.exe -P clean -no-remote'
alias fn=dist/bin/fennec.exe
alias clobber='autoconf-2.13 && pushd js/src && autoconf-2.13 && pushd ../../obj-dir && ../configure && python -O "../build/pymake/make.py" -s -j12 && popd && popd && beep32'
mk() {
  last=${!#};
  for folder in "$@"; do
    make -sC $folder -j4
    RESULT=$?
    if [ $RESULT -gt 0 ]; then
      echo Error making $folder
      return $RESULT
    else
      echo Made $folder
    fi
  done
}

Clobber builds (rebuilding the whole platform and browser) on Windows can take a really long time to complete, so I have my clobber builds make an obnoxious amount of beeps (32) when they complete.

I use Firefox as my default browser while working, so I use a separate profile for my local build (“clean”). I wipe this profile often, hence the “clean” name. By typing fx in my terminal, it runs Firefox in the default location (relative to my object directory), and passes the necessary arguments so it doesn’t conflict with my already running instance of Firefox.

The mk function that I have allows me to chain many folders together for a build and reduces the amount of typing I have to do. If I make some changes to the Firefox theme and the browser frontend, I can just type: mk browser/themes browser/base && fx to rebuild the necessary folders and then run Firefox.

So that’s it for my bash profile, it’s admittedly pretty small. Take a look at Paul Rouget’s .vimrc for some more awesome commands.

Tagged: , , ,

§ One Response to My bash profile

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading My bash profile at JAWS.

meta

Follow

Get every new post delivered to your Inbox.

Join 1,007 other followers