Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MLKrisJohnson/2c2433d342ae4b64918ee5d91ed3d120 to your computer and use it in GitHub Desktop.
Save MLKrisJohnson/2c2433d342ae4b64918ee5d91ed3d120 to your computer and use it in GitHub Desktop.
AppleScript that sets background colors of terminal windows to different colors, for easier identification
-- Set background colors of terminal windows to different colors, for easier identification
tell application "Terminal"
set window_colors to {¬
{8192, 0, 0}, ¬
{0, 8192, 0}, ¬
{0, 0, 8192}, ¬
{4096, 4096, 0}, ¬
{0, 4096, 4096}, ¬
{4096, 0, 4096}, ¬
{2048, 2048, 2048}}
set window_colors_count to count of window_colors
set i to 0
repeat with current_window in windows
set color_index to (i mod window_colors_count) + 1
set the_color to (item color_index of window_colors)
set background color of current_window to the_color
set i to i + 1
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment