mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-21 08:41:00 +02:00
colors: Remove export_plain
This commit is contained in:
parent
7f78e52965
commit
1abdf7bb30
11
wal
11
wal
@ -24,6 +24,7 @@ CACHE_DIR = pathlib.Path.home() / ".cache/wal/"
|
|||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class ColorType(object):
|
class ColorType(object):
|
||||||
"""Store colors in various formats."""
|
"""Store colors in various formats."""
|
||||||
|
plain = []
|
||||||
xrdb = []
|
xrdb = []
|
||||||
sequences = []
|
sequences = []
|
||||||
shell = []
|
shell = []
|
||||||
@ -270,6 +271,7 @@ def set_special(index, color):
|
|||||||
def set_color(index, color):
|
def set_color(index, color):
|
||||||
"""Build the escape sequence we need for each color."""
|
"""Build the escape sequence we need for each color."""
|
||||||
index = str(index)
|
index = str(index)
|
||||||
|
ColorType.plain.append("%s\n" % (color))
|
||||||
ColorType.xrdb.append("*.color%s: %s\n" % (index, color))
|
ColorType.xrdb.append("*.color%s: %s\n" % (index, color))
|
||||||
ColorType.xrdb.append("*color%s: %s\n" % (index, color))
|
ColorType.xrdb.append("*color%s: %s\n" % (index, color))
|
||||||
ColorType.sequences.append("\\033]4;%s;%s\\007" % (index, color))
|
ColorType.sequences.append("\\033]4;%s;%s\\007" % (index, color))
|
||||||
@ -435,13 +437,6 @@ def save_colors(colors, export_file, message):
|
|||||||
print("export: exported %s." % (message))
|
print("export: exported %s." % (message))
|
||||||
|
|
||||||
|
|
||||||
def export_plain(colors):
|
|
||||||
"""Export colors to a plain text file."""
|
|
||||||
with open(CACHE_DIR / "colors", "w") as file:
|
|
||||||
file.write("\n".join(colors))
|
|
||||||
print("export: Exported plain colors")
|
|
||||||
|
|
||||||
|
|
||||||
def export_rofi(colors):
|
def export_rofi(colors):
|
||||||
"""Append rofi colors to the x_colors list."""
|
"""Append rofi colors to the x_colors list."""
|
||||||
ColorType.xrdb.append("rofi.color-window: %s, %s, %s\n"
|
ColorType.xrdb.append("rofi.color-window: %s, %s, %s\n"
|
||||||
@ -473,7 +468,7 @@ def export_xrdb(colors, export_file):
|
|||||||
|
|
||||||
def export_colors(colors):
|
def export_colors(colors):
|
||||||
"""Export colors in various formats."""
|
"""Export colors in various formats."""
|
||||||
export_plain(colors)
|
save_colors(ColorType.plain, CACHE_DIR / "colors", "plain hex colors")
|
||||||
save_colors(ColorType.shell, CACHE_DIR / "colors.sh", "shell variables")
|
save_colors(ColorType.shell, CACHE_DIR / "colors.sh", "shell variables")
|
||||||
|
|
||||||
# Web based colors.
|
# Web based colors.
|
||||||
|
Loading…
Reference in New Issue
Block a user