Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2018 18:23
What would you like to do?
# auto match window title and tab background color with
# terminal background color for iTerm2
# append to your .bashrc, .zshrc or whatever
# does not really work with High Sierra
# to reset:
# echo -e "\033]6;1;bg;*;default\a"
osascript -e \
'tell application "iTerm"
tell current session of current window
get background color
end tell
end tell' |\
tr -d ',' |\
xargs -n 1 -I {} expr {} / 257 |\
paste <(echo -e 'red\ngreen\nblue') - |\
awk '{ print "\033]6;1;bg;"$1";brightness;"$2"\a" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment