mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-10 07:58:12 +01:00
Merge pull request #68 from aeikenberry/master
Adds support for changing tab bar color in iTerm
This commit is contained in:
commit
2b220aec72
@ -28,6 +28,16 @@ def set_color(index, color):
|
|||||||
return f"\033]4;{index};{color}\007"
|
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):
|
def create_sequences(colors, vte):
|
||||||
"""Create the escape sequences."""
|
"""Create the escape sequences."""
|
||||||
# Colors 0-15.
|
# 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(12, colors["special"]["cursor"], "l"))
|
||||||
sequences.append(set_special(13, 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.
|
# This escape sequence doesn"t work in VTE terminals.
|
||||||
if not vte:
|
if not vte:
|
||||||
sequences.append(set_special(708, colors["special"]["background"]))
|
sequences.append(set_special(708, colors["special"]["background"]))
|
||||||
|
Loading…
Reference in New Issue
Block a user