mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-12-01 20:33:51 +01:00
sequences: Send colors 0-15
This commit is contained in:
parent
ddcd568289
commit
ca63452eb1
@ -3,7 +3,7 @@ Send sequences to all open terminals.
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .settings import CACHE_DIR
|
from .settings import CACHE_DIR, OS
|
||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
@ -19,6 +19,9 @@ def set_special(index, color):
|
|||||||
|
|
||||||
def set_color(index, color):
|
def set_color(index, color):
|
||||||
"""Convert a hex color to a text color sequence."""
|
"""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"
|
return f"\033]4;{index};{color}\007"
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ Created by Dylan Araps.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import platform
|
||||||
|
|
||||||
|
|
||||||
__version__ = "0.5.7"
|
__version__ = "0.5.7"
|
||||||
@ -19,3 +20,4 @@ HOME = pathlib.Path.home()
|
|||||||
CACHE_DIR = HOME / ".cache/wal/"
|
CACHE_DIR = HOME / ".cache/wal/"
|
||||||
MODULE_DIR = pathlib.Path(__file__).parent
|
MODULE_DIR = pathlib.Path(__file__).parent
|
||||||
COLOR_COUNT = 16
|
COLOR_COUNT = 16
|
||||||
|
OS = platform.uname()[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user