Created
June 9, 2014 22:51
-
-
Save phlco/50361c1568b4187ac1d7 to your computer and use it in GitHub Desktop.
Toggles Terminal themes and font sizes
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
#------------------------------------------------------------------------------- | |
# Terminal Toggle | |
# Toggles Terminal themes and font sizes | |
#------------------------------------------------------------------------------- | |
THEME_LIGHT="Tomorrow" | |
THEME_DARK="Tomorrow\ Night" | |
FONT_BIG=25 | |
FONT_SMALL=14 | |
toggle_theme() { | |
local setting="$1" | |
osascript -e "tell application \"Terminal\" to set current settings \ | |
of front window to first settings set whose name is \"$setting\"" | |
} | |
toggle_font_size() { | |
local size="$1" | |
osascript -e "tell application \"Terminal\" to set font size \ | |
of current settings of the front window to $size" | |
} | |
# Themes | |
alias light="toggle_theme $THEME_LIGHT" | |
alias dark="toggle_theme $THEME_DARK" | |
# Font Sizes | |
alias big="toggle_font_size $FONT_BIG" | |
alias sm="toggle_font_size $FONT_SMALL" | |
# Resources | |
# http://superuser.com/questions/187591/os-x-terminal-command-to-change-color-themes/209920#209920 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment