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
#!/bin/bash | |
# | |
# 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