summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpywal/__main__.py7
-rw-r--r--pywal/export.py19
-rw-r--r--pywal/set_colors.py19
-rw-r--r--pywal/settings.py2
-rw-r--r--setup.py2
5 files changed, 23 insertions, 26 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index c78059a..13e171e 100755
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -15,9 +15,6 @@ from pywal import wallpaper
from pywal import util
-__version__ = "0.1.6"
-
-
def get_args():
"""Get the script arguments."""
description = "wal - Generate colorschemes on the fly"
@@ -73,11 +70,11 @@ def process_args(args):
# -r
if args.r:
- export.reload_colors(args.t)
+ set_colors.reload_colors(args.t)
# -v
if args.v:
- print(f"wal {__version__}")
+ print(f"wal {s.__version__}")
exit(0)
# -i
diff --git a/pywal/export.py b/pywal/export.py
index a153f7f..bfe3974 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -1,8 +1,6 @@
"""
Export colors in various formats.
"""
-import pathlib
-import re
import shutil
import subprocess
@@ -17,23 +15,6 @@ def save_colors(colors, export_file, message):
print(f"export: exported {message}.")
-def reload_colors(vte):
- """Reload colors."""
- sequence_file = pathlib.Path(s.CACHE_DIR / "sequences")
-
- if sequence_file.is_file():
- sequences = "".join(util.read_file(sequence_file))
-
- # If vte mode was used, remove the problem sequence.
- if vte:
- sequences = re.sub(r"\]708;\#.{6}", "", sequences)
-
- # Make the terminal interpret escape sequences.
- print(util.fix_escape(sequences), end="")
-
- exit(0)
-
-
def reload_xrdb(export_file):
"""Merge the colors into the X db so new terminals use them."""
if shutil.which("xrdb"):
diff --git a/pywal/set_colors.py b/pywal/set_colors.py
index 4b3c74f..7f395e9 100644
--- a/pywal/set_colors.py
+++ b/pywal/set_colors.py
@@ -2,6 +2,8 @@
Send sequences to all open terminals.
"""
import os
+import pathlib
+import re
from pywal import settings as s
from pywal import util
@@ -90,3 +92,20 @@ def send_sequences(colors, vte):
[util.save_file(sequences, term) for term in terminals]
print("colors: Set terminal colors")
+
+
+def reload_colors(vte):
+ """Reload colors."""
+ sequence_file = pathlib.Path(s.CACHE_DIR / "sequences")
+
+ if sequence_file.is_file():
+ sequences = "".join(util.read_file(sequence_file))
+
+ # If vte mode was used, remove the problem sequence.
+ if vte:
+ sequences = re.sub(r"\]708;\#.{6}", "", sequences)
+
+ # Make the terminal interpret escape sequences.
+ print(util.fix_escape(sequences), end="")
+
+ exit(0)
diff --git a/pywal/settings.py b/pywal/settings.py
index 387178b..cb676f2 100644
--- a/pywal/settings.py
+++ b/pywal/settings.py
@@ -4,7 +4,7 @@ Global variables and classes.
import pathlib
-__version__ = "0.1.6"
+__version__ = "0.2.0"
# Internal variables.
diff --git a/setup.py b/setup.py
index c0f86ed..4fe010f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
"""wal - setup.py"""
from setuptools import setup
-import pywal.__main__ as pywal
+import pywal.settings as pywal
DESC = (