summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pywal/colors.py25
-rw-r--r--pywal/colorschemes/solarized-dark.json25
2 files changed, 43 insertions, 7 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index f47ac33..4bd3655 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -7,7 +7,7 @@ import shutil
import subprocess
import sys
-from .settings import CACHE_DIR, COLOR_COUNT, __cache_version__
+from .settings import CACHE_DIR, COLOR_COUNT, MODULE_DIR, __cache_version__
from . import util
@@ -129,12 +129,23 @@ def get(img, cache_dir=CACHE_DIR,
def file(input_file):
"""Import colorscheme from json file."""
- data = util.read_file_json(input_file)
+ theme_file = os.path.join(MODULE_DIR, "colorschemes",
+ ".".join((input_file, "json")))
- if "wallpaper" not in data:
- data["wallpaper"] = "None"
+ if os.path.isfile(theme_file):
+ input_file = theme_file
- if "alpha" not in data:
- data["alpha"] = "100"
+ if os.path.isfile(input_file):
+ data = util.read_file_json(input_file)
- return data
+ if "wallpaper" not in data:
+ data["wallpaper"] = "None"
+
+ if "alpha" not in data:
+ data["alpha"] = "100"
+
+ return data
+
+ else:
+ print("No colorscheme file found, exiting...")
+ sys.exit(1)
diff --git a/pywal/colorschemes/solarized-dark.json b/pywal/colorschemes/solarized-dark.json
new file mode 100644
index 0000000..a611e31
--- /dev/null
+++ b/pywal/colorschemes/solarized-dark.json
@@ -0,0 +1,25 @@
+{
+ "special": {
+ "background": "#073642",
+ "foreground": "#fdf6e3",
+ "cursor": "#dc322f"
+ },
+ "colors": {
+ "color0": "#073642",
+ "color1": "#dc322f",
+ "color2": "#859900",
+ "color3": "#b58900",
+ "color4": "#268bd2",
+ "color5": "#d33682",
+ "color6": "#2aa198",
+ "color7": "#eee8d5",
+ "color8": "#6c7c80",
+ "color9": "#dc322f",
+ "color10": "#859900",
+ "color11": "#b58900",
+ "color12": "#268bd2",
+ "color13": "#d33682",
+ "color14": "#2aa198",
+ "color15": "#eee8d5"
+ }
+}