#!/bin/bash MUTT='mutt -f =INBOX' # quick and dirty check for whether X is running if [ ! -z $DISPLAY ]; then # assuming X is available gnome-terminal --window-with-profile mutt --geometry=110x40 --command "$MUTT" else # assuming X is NOT available $MUTT fi