From ca63452eb14a4e8211ea578061973600e6b4242d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 30 Jul 2017 22:16:41 +1000 Subject: [PATCH] sequences: Send colors 0-15 --- pywal/sequences.py | 5 ++++- pywal/settings.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pywal/sequences.py b/pywal/sequences.py index 4e1457d..030f030 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -3,7 +3,7 @@ Send sequences to all open terminals. """ import os -from .settings import CACHE_DIR +from .settings import CACHE_DIR, OS from . import util @@ -19,6 +19,9 @@ def set_special(index, color): def set_color(index, color): """Convert a hex color to a text color sequence.""" + if OS == "Darwin": + return f"\033]P{index:x}{color.strip('#')}\033\\" + return f"\033]4;{index};{color}\007" diff --git a/pywal/settings.py b/pywal/settings.py index 812c050..a58930a 100644 --- a/pywal/settings.py +++ b/pywal/settings.py @@ -10,6 +10,7 @@ Created by Dylan Araps. """ import pathlib +import platform __version__ = "0.5.7" @@ -19,3 +20,4 @@ HOME = pathlib.Path.home() CACHE_DIR = HOME / ".cache/wal/" MODULE_DIR = pathlib.Path(__file__).parent COLOR_COUNT = 16 +OS = platform.uname()[0]