Last active
November 11, 2015 23:09
-
-
Save mkgl/f5e470cb54fcdc59cd6e to your computer and use it in GitHub Desktop.
Changing Terminal colors with style (Applescript)
This file contains hidden or 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
global favThemes | |
set favThemes to {"Basic", "Pro Blue", "Pro Mint", "Pro Plum", "Pro Red", "Pro Gold", "Pro"} | |
tell application "Terminal" | |
# Get current settings | |
set theme to the name of the current settings of the selected tab of the front window | |
set i to my index_of(theme) | |
# Find next settings | |
set next to (i mod (count of favThemes) + 1) | |
set nextTheme to item next of favThemes | |
# Apply next settings | |
set current settings of the selected tab of the front window to item 1 of (settings sets whose name is nextTheme) | |
end tell | |
on index_of(this_item) | |
repeat with i from 1 to the count of favThemes | |
if item i of favThemes is this_item then return i | |
end repeat | |
return 0 | |
end index_of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changing Terminal colors with style
For some time I wanted to get that nerdy script updating colors of Terminal windows—helping distinguish them when multi-tasking/getting myself (heavily) side-tracked.
Except the pseudo-designer in me could simply not bear random
dodgycolor schemes ;) so I ended up rolling my own script. It essentially cycles through a list of predefined Terminal window settings; I carefully curated colorful variations of the "Pro" theme + the "Basic" one.Thanks to the interwebs for the 45-minute dose of Applescript basics, and for the index_of function. :)