-
-
Save bendog/2f1a31ba9e53f8139f796e88539bd1ab to your computer and use it in GitHub Desktop.
~/bin/ssh wrapper to change Mac OS Terminal profiles when running SSH
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
#!/bin/sh | |
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 | |
bendog.org|celeste.bendog.org) set_bg "bendog.org" ;; | |
*) set_bg "ssh" ;; | |
esac | |
/usr/bin/ssh "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment