summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylanaraps@users.noreply.github.com>2017-08-02 13:16:07 +1000
committerGitHub <noreply@github.com>2017-08-02 13:16:07 +1000
commit2b220aec72c0550e00b7f5c5bf062e1418e3dfcc (patch)
treee91cc6f83b6e8bd4b620f42a7e7c51c43bfb13c3
parent2237894f678d4cfd449d960048819dc3c8f4010c (diff)
parent7f6f690ca74eb7f102fbd0026dbd3aad25b5af7b (diff)
Merge pull request #68 from aeikenberry/master
Adds support for changing tab bar color in iTerm
-rw-r--r--pywal/sequences.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pywal/sequences.py b/pywal/sequences.py
index bbe7c72..c254de0 100644
--- a/pywal/sequences.py
+++ b/pywal/sequences.py
@@ -28,6 +28,16 @@ def set_color(index, color):
return f"\033]4;{index};{color}\007"
+def set_iterm_tab_color(color):
+ """Set iTerm2 window color"""
+ red, green, blue = util.hex_to_rgb(color)
+ return [
+ f"\033]6;1;bg;red;brightness;{red}\a",
+ f"\033]6;1;bg;green;brightness;{green}\a",
+ f"\033]6;1;bg;blue;brightness;{blue}\a",
+ ]
+
+
def create_sequences(colors, vte):
"""Create the escape sequences."""
# Colors 0-15.
@@ -47,6 +57,9 @@ def create_sequences(colors, vte):
sequences.append(set_special(12, colors["special"]["cursor"], "l"))
sequences.append(set_special(13, colors["special"]["cursor"], "l"))
+ if OS == "Darwin":
+ sequences += set_iterm_tab_color(colors["special"]["background"])
+
# This escape sequence doesn"t work in VTE terminals.
if not vte:
sequences.append(set_special(708, colors["special"]["background"]))