summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-03-15 17:19:01 +1100
committerDylan Araps <dylan.araps@gmail.com>2018-03-15 17:19:01 +1100
commit90a73edda5a6484a8ad4dc081e22c0d9e53cc5e1 (patch)
treeb16290d5e17a3478bc3ad0fbd25dd8c2d3b41a2a /pywal
parenta95d901deab1abd19fb4bacd9b4704eae48c0ffb (diff)
themes: Add support for terminal.sexy json
Diffstat (limited to 'pywal')
-rw-r--r--pywal/colors.py22
-rw-r--r--pywal/colorschemes/gruvbox.json2
-rw-r--r--pywal/colorschemes/zenburn.json25
3 files changed, 48 insertions, 1 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 4bd3655..bff33c4 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -127,6 +127,24 @@ def get(img, cache_dir=CACHE_DIR,
return colors
+def terminal_sexy_to_wal(data):
+ """Convert terminal.sexy json schema to wal."""
+ data["colors"] = {}
+ data["special"] = {}
+
+ for i in range(0, 16):
+ data["colors"]["color%s" % i] = data["color"][i if i < 9 else i - 8]
+
+ data["colors"]["color0"] = data["background"]
+ data["colors"]["color7"] = data["foreground"]
+ data["colors"]["color15"] = data["foreground"]
+ data["special"]["foreground"] = data["foreground"]
+ data["special"]["background"] = data["background"]
+ data["special"]["cursor"] = data["colors"]["color1"]
+
+ return data
+
+
def file(input_file):
"""Import colorscheme from json file."""
theme_file = os.path.join(MODULE_DIR, "colorschemes",
@@ -144,6 +162,10 @@ def file(input_file):
if "alpha" not in data:
data["alpha"] = "100"
+ # Terminal.sexy format.
+ if isinstance(data["color"], list):
+ data = terminal_sexy_to_wal(data)
+
return data
else:
diff --git a/pywal/colorschemes/gruvbox.json b/pywal/colorschemes/gruvbox.json
index 5f7f8f7..6f864d6 100644
--- a/pywal/colorschemes/gruvbox.json
+++ b/pywal/colorschemes/gruvbox.json
@@ -2,7 +2,7 @@
"special": {
"background": "#282828",
"foreground": "#a89984",
- "cursor": "#dc322f"
+ "cursor": "#cc241d"
},
"colors": {
"color0": "#282828",
diff --git a/pywal/colorschemes/zenburn.json b/pywal/colorschemes/zenburn.json
new file mode 100644
index 0000000..b0b9c53
--- /dev/null
+++ b/pywal/colorschemes/zenburn.json
@@ -0,0 +1,25 @@
+{
+ "special": {
+ "background": "#3f3f3f",
+ "foreground": "#dcdccc",
+ "cursor": "#cc9393"
+ },
+ "colors": {
+ "color0": "#3f3f3f",
+ "color1": "#cc9393",
+ "color2": "#7f9f7f",
+ "color3": "#d0bf8f",
+ "color4": "#6ca0a3",
+ "color5": "#dc8cc3",
+ "color6": "#93e0e3",
+ "color7": "#dcdccc",
+ "color8": "#828282",
+ "color9": "#cc9393",
+ "color10": "#7f9f7f",
+ "color11": "#d0bf8f",
+ "color12": "#6ca0a3",
+ "color13": "#dc8cc3",
+ "color14": "#93e0e3",
+ "color15": "#dcdccc"
+ }
+}