Skip to content

Instantly share code, notes, and snippets.

Last active Aug 16, 2017
What would you like to do?
~/bin/ssh wrapper to change Mac OS Terminal profiles when running SSH
HOSTNAME=`echo $@ | sed s/.*@//`
set_bg () {
osascript -e "tell application \"Terminal\" to set current settings of window 1 to (first settings set whose name is \"$1\")"
on_exit () {
set_bg "BenDog"
trap on_exit EXIT
case $HOSTNAME in| set_bg "" ;;
*) set_bg "ssh" ;;
/usr/bin/ssh "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment