summaryrefslogtreecommitdiff
path: root/pywal/wal.py
diff options
context:
space:
mode:
authordylan araps <dylan.araps@gmail.com>2017-07-20 13:40:31 +1000
committerdylan araps <dylan.araps@gmail.com>2017-07-20 13:40:31 +1000
commit88bdd9ab013bad324e1f3f4ad8516fd6d55ca312 (patch)
treee41af644ec255deecda3156f2581182d312e7662 /pywal/wal.py
parent8917eef29e0d9279a74c35e0a59b29c9a89fbbc7 (diff)
api: Use wal file in __main__.py
Diffstat (limited to 'pywal/wal.py')
-rw-r--r--pywal/wal.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/pywal/wal.py b/pywal/wal.py
index db8dccd..67109f1 100644
--- a/pywal/wal.py
+++ b/pywal/wal.py
@@ -2,6 +2,8 @@
wal - Generate and change colorschemes on the fly.
Created by Dylan Araps.
"""
+from pywal.settings import CACHE_DIR
+from pywal import export
from pywal import image
from pywal import magic
from pywal import reload
@@ -14,11 +16,9 @@ def get_image(img):
return image.get_image(img)
-def create_palette(img):
+def create_palette(img, quiet=False):
"""Create a palette and return it as a dict."""
- colors = magic.gen_colors(img)
- colors = magic.sort_colors(img, colors)
- return colors
+ return magic.get_colors(img, quiet)
def send_sequences(colors, vte):
@@ -31,11 +31,16 @@ def reload_env():
reload.reload_env()
+def export_all_templates(colors, template_dir=None, export_dir=CACHE_DIR):
+ """Export all templates."""
+ export.export_all_templates(colors, template_dir, export_dir)
+
+
def set_wallpaper(img):
"""Set the wallpaper."""
wallpaper.set_wallpaper(img)
-# def reload_colors(vte):
-# """Reload the colors."""
-# sequences.reload_colors(vte)
+def reload_colors(vte, sequence_file=None):
+ """Reload the colors."""
+ sequences.reload_colors(vte, sequence_file)