diff --git a/pywal/__main__.py b/pywal/__main__.py index 36cec51..44663df 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -91,7 +91,7 @@ def process_args(args): colors_plain = colors.get(image_file, notify=not args.q) if args.f: - colors_plain = util.read_file_json(args.f) + colors_plain = colors.load(args.f) if args.i or args.f: sequences.send(colors_plain, args.t) diff --git a/pywal/colors.py b/pywal/colors.py index 08490a4..0ede3e1 100644 --- a/pywal/colors.py +++ b/pywal/colors.py @@ -93,3 +93,13 @@ def get(img, cache_dir=__cache_dir__, util.msg("wal: Generation complete.", notify) return colors + + +def file(input_file): + """Import colorscheme from json file.""" + data = util.read_file_json(input_file) + + if "wallpaper" not in data: + data["wallpaper"] = "None" + + return data diff --git a/pywal/util.py b/pywal/util.py index 6338989..1df3c9f 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -55,9 +55,6 @@ def read_file_json(input_file): with open(input_file, "r") as json_file: data = json.load(json_file) - if "wallpaper" not in data: - data["wallpaper"] = "None" - return data