Created
June 14, 2016 15:43
-
-
Save highruned/646bb9e282d0e12892c995bcbcd10e74 to your computer and use it in GitHub Desktop.
Persistent iTerm Tab Titles
This file contains 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
# $1 = type; 0 - both, 1 - tab, 2 - title | |
# rest = text | |
setTerminalText () { | |
# echo works in bash & zsh | |
local mode=$1 ; shift | |
echo -ne "\033]$mode;$@\007" | |
} | |
set_tab_name () { setTerminalText 1 $@; } | |
stt_title_name () { setTerminalText 2 $@; } | |
set_tab_and_title_name () { setTerminalText 0 $@; } | |
setup_projects () { | |
case :$PWD: in | |
# Sites | |
*/Users/ericmuyser/Sites/Esgaroth*) | |
set_tab_name Esgaroth | |
nvm use 5.5.0 | |
;; | |
*/Users/ericmuyser/Sites/Horadric*) | |
set_tab_name Horadric | |
nvm use 5.5.0 | |
;; | |
*/ude/bb/sites/brickbrotherhood.com*) | |
set_tab_name Brick Brotherhood | |
nvm use 5.5.0 | |
;; | |
*/ude/mi/repos/holland-america-mobile*) | |
set_tab_name Holland America | |
nvm use 0.10.26 | |
;; | |
*/ude/mi/repos/dollar-tree-mobile/dollartree-smartphone*) | |
set_tab_name Dollar Tree | |
nvm use 0.10.26 | |
;; | |
*/ude/mi/repos/matalan*) | |
set_tab_name Matalan | |
nvm use 0.10.26 | |
;; | |
# Tools | |
*/Users/ericmuyser/Tools/Odyssey*) | |
set_tab_name Odyssey | |
nvm use 5.5.0 | |
;; | |
*/Users/ericmuyser/Tools/Cain*) | |
set_tab_name Cain | |
nvm use 5.5.0 | |
;; | |
*/ude/mi/repos/adaptivejs-docs*) | |
set_tab_name Docs | |
;; | |
# Games | |
*/Users/ericmuyser/Games/Artemis*) | |
set_tab_name Artemis | |
;; | |
*/Users/ericmuyser/Games/Adama*) | |
set_tab_name Adama | |
;; | |
*/Users/ericmuyser/Games/Alcyone*) | |
set_tab_name Alcyone | |
;; | |
*/Users/ericmuyser/Games/Electra*) | |
set_tab_name Electra | |
;; | |
esac | |
} | |
on_startup () { | |
ulimit -n 9000 | |
setup_projects | |
} | |
on_enter_directory () { | |
setup_projects | |
} | |
export NVM_DIR="/Users/ericmuyser/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
on_startup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment