Created
March 20, 2012 02:07
-
-
Save evanmoran/2130081 to your computer and use it in GitHub Desktop.
Bash script to open new terminal windows / tabs by theme
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
function terminal_open { | |
osascript -e 'tell application "Terminal" to activate' \ | |
-e 'tell application "System Events"' \ | |
-e 'tell process "Terminal"' \ | |
-e "tell menu item \"${1}\" of menu \"New ${2}\" of menu item \"New ${2}\" of menu \"Shell\" of menu bar item \"Shell\" of menu bar 1" \ | |
-e 'click' \ | |
-e 'end tell' \ | |
-e 'end tell' \ | |
-e 'end tell' > /dev/null | |
} | |
# Open new windows by terminal theme name | |
alias lw='echo "[light window]"; terminal_open "Solarized Light" "Window"' | |
alias dw='echo "[dark window]"; terminal_open "Solarized Dark" "Window"' | |
# Open new tabs by terminal theme name | |
alias lt='echo "[light tab]"; terminal_open "Solarized Light" "Tab"' | |
alias dt='echo "[dark tab]"; terminal_open "Solarized Dark" "Tab"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment