Start desktop applications automatically as background jobs from bash

Are you working with the linux command line frequently? Are you tired of typing > /dev/null & every time you want to start a desktop application? Well, I have a small snippet of bash that solves this problem!

Just add the following few lines to your .bash_aliases or .bashrc:

  1. # Put some applications automatically in the background
  2. function runbg {
  3. "$@" 2> /dev/null > /dev/null &
  4. }
  5. for app in eclipse gedit firefox
  6. do
  7. alias $app="runbg $app"
  8. done