Skip to content

Instantly share code, notes, and snippets.

@igolden
Created August 31, 2017 00:32
Show Gist options
  • Save igolden/b287a695d3526832408fbebd7d520b5b to your computer and use it in GitHub Desktop.
Save igolden/b287a695d3526832408fbebd7d520b5b to your computer and use it in GitHub Desktop.
Set the iTerm background programatically
# Changes the background color of
# iTerm window using applescript
#
# @param colorMatrix {Object} -- {100,0,0}
#
# @usage adjustBackground "{100,0,0}"
adjustBackground() {
osascript -e "tell application \"iTerm\"
set current_terminal to (current terminal)
tell current_terminal
set current_session to (current session)
tell current_session
set background color to $1
end tell
end tell
end tell"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment