For iTerm I also set the shortcut for "New Tab with Current Profile" to ⌘T
to overrite openning a new tab with the default profile instead of the current one.
Last active
March 4, 2016 15:48
-
-
Save adamwalzer/ca4ae4890c78992c5301 to your computer and use it in GitHub Desktop.
Bash Background Changer for Directory Navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLICOLOR=1 | |
export TERM=xterm-256color | |
function cd() { | |
builtin cd "$@"; | |
shopt -s nocasematch | |
if [[ "$PWD" == *"/Users/adamwalzer/Sites/cmwn-games-artifact"* ]] | |
then | |
echo -e "\033]50;SetProfile=Dev\a" | |
elif [[ "$PWD" == *"/Users/adamwalzer/Sites/cmwn-games-prod"* ]] | |
then | |
echo -e "\033]50;SetProfile=Prod\a" | |
elif [[ "$PWD" == *"/Users/adamwalzer/Sites/cmwn-games-staging"* ]] | |
then | |
echo -e "\033]50;SetProfile=Staging\a" | |
elif [[ "$PWD" == *"/Users/adamwalzer/Sites/js-interactive-library"* ]] | |
then | |
echo -e "\033]50;SetProfile=Lib\a" | |
else | |
echo -e "\033]50;SetProfile=Gaming\a" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment