Skip to content

Instantly share code, notes, and snippets.

@Andrew8xx8
Created December 1, 2012 17:17
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Andrew8xx8/4183308 to your computer and use it in GitHub Desktop.
Save Andrew8xx8/4183308 to your computer and use it in GitHub Desktop.
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"
@Andrew8xx8
Copy link
Author

Usage:

open.sh -p my/cool/project

Enjoy!

@Andrew8xx8
Copy link
Author

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