mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-25 07:19:27 +01:00
themes: Initial theme support
This commit is contained in:
parent
da9226a8c4
commit
cb3d53ee0c
@ -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)
|
||||
|
25
pywal/colorschemes/solarized-dark.json
Normal file
25
pywal/colorschemes/solarized-dark.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user