Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Opens terminal with specified tabs
#!/bin/bash
USAGE="Usage: -p Project path"
while getopts p: options; do
case $options in
p ) PROJECT="$OPTARG";;
esac
done
if [ $# -eq 0 ]; then
echo $USAGE
exit
fi
PROJECT_NAME=`basename $PROJECT`
GLOBAL_OPTIONS="--maximize --hide-menubar --disable-factory"
TAB1="zsh -c 'cd $PROJECT && vim'"
TITLE1="VIM | [$PROJECT_NAME]"
TAB2="sh -c 'cd $PROJECT; git st; exec zsh'"
TITLE2="CONSOLE | [$PROJECT_NAME]"
TAB3="sh -c 'cd $PROJECT; exec zsh'"
TITLE3="SERVER | [$PROJECT_NAME]"
mate-terminal $GLOBAL_OPTIONS --tab -e "$TAB1" --title "$TITLE1" --tab -e "$TAB2" --title "$TITLE2" --tab -e "$TAB3" --title "$TITLE3"
Owner

Andrew8xx8 commented Dec 1, 2012

Usage:

open.sh -p my/cool/project

Enjoy!

Owner

Andrew8xx8 commented Dec 1, 2012

For gnome terminal please relapse mate-terminal by gnome-terminal
For bash shell replace zsh by bash or any another shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment