Created
December 9, 2012 21:55
-
-
Save nevali/4247196 to your computer and use it in GitHub Desktop.
Command-line script to adjust a Mac OS X Terminal.app's settings set
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 | |
if test x"$1" = x"" ; then | |
echo "Usage: $0 SETTINGS-SET" >&2 | |
exit 1 | |
fi | |
settings="$1" | |
tty=`tty 2>/dev/null` | |
if test x"$tty" = x"" || test x"$tty" = x"not a tty" ; then | |
echo "$0: not a tty" >&2 | |
exit 1 | |
fi | |
/usr/bin/osascript <<EOF | |
tell application "Terminal" | |
repeat with theWindow in windows | |
repeat with theTab in theWindow's tabs | |
if theTab's tty is "$tty" then | |
set theTab's current settings to settings set "$settings" | |
return | |
end if | |
end repeat | |
end repeat | |
end tell | |
EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment