Skip to content

Instantly share code, notes, and snippets.

@nevali
Created December 9, 2012 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevali/4247196 to your computer and use it in GitHub Desktop.
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
#! /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