Guest User

Untitled

a guest
Jun 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # auto match window title and tab background color with
  4. # terminal background color for iTerm2
  5. # append to your .bashrc, .zshrc or whatever
  6. # does not really work with High Sierra
  7. # to reset:
  8. # echo -e "\033]6;1;bg;*;default\a"
  9.  
  10. osascript -e \
  11. 'tell application "iTerm"
  12. tell current session of current window
  13. get background color
  14. end tell
  15. end tell' |\
  16. tr -d ',' |\
  17. xargs -n 1 -I {} expr {} / 257 |\
  18. paste <(echo -e 'red\ngreen\nblue') - |\
  19. awk '{ print "\033]6;1;bg;"$1";brightness;"$2"\a" }'
Add Comment
Please, Sign In to add comment