aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <[email protected]>2018-04-09 09:09:23 +1000
committerDylan Araps <[email protected]>2018-04-09 09:09:23 +1000
commit97b241c9160ad9304fdd281e735c21c238a028af (patch)
tree0dfca271819b13d314e870760bfa6033582b4804
parentversion: bump (diff)
downloadpywal-97b241c9160ad9304fdd281e735c21c238a028af.tar.xz
pywal-97b241c9160ad9304fdd281e735c21c238a028af.zip
misc: fixes
-rw-r--r--pywal/__main__.py8
-rw-r--r--pywal/backends/colorz.py2
-rw-r--r--pywal/reload.py9
3 files changed, 10 insertions, 9 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index a06eab9..f448607 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -104,6 +104,10 @@ def parse_args_exit(parser):
if args.i and args.theme:
parser.error("Conflicting arguments -i and -f.")
+ if args.r:
+ reload.colors()
+ sys.exit(0)
+
if not args.i and \
not args.theme and \
not args.R and \
@@ -111,10 +115,6 @@ def parse_args_exit(parser):
parser.error("No input specified.\n"
"--backend, --theme, -i or -R are required.")
- if args.r:
- reload.colors()
- sys.exit(0)
-
if args.theme == "list_themes":
themes = [theme.name.replace(".json", "")
for theme in theme.list_themes()]
diff --git a/pywal/backends/colorz.py b/pywal/backends/colorz.py
index 490f585..642ff6b 100644
--- a/pywal/backends/colorz.py
+++ b/pywal/backends/colorz.py
@@ -12,7 +12,7 @@ from .. import util
def gen_colors(img):
"""Generate a colorscheme using Colorz."""
- cmd = ["colorz", "-n", "6", "--bold", "0", "--no-preview"]
+ cmd = ["colorz", "-n", "6", "--bold", "0", "--no-preview", "--no-bg-img"]
return subprocess.check_output([*cmd, img]).splitlines()
diff --git a/pywal/reload.py b/pywal/reload.py
index 02d1073..6c12387 100644
--- a/pywal/reload.py
+++ b/pywal/reload.py
@@ -14,8 +14,9 @@ from . import util
def tty(tty_reload):
"""Load colors in tty."""
tty_script = os.path.join(CACHE_DIR, "colors-tty.sh")
+ term = os.environ.get("TERM")
- if os.path.isfile(tty_script) and tty_reload:
+ if tty_reload and term == "linux":
subprocess.Popen(["sh", tty_script])
@@ -26,7 +27,7 @@ def xrdb(xrdb_files=None):
if shutil.which("xrdb") and OS != "Darwin":
for file in xrdb_files:
- subprocess.run(["xrdb", "-merge", "-nocpp", file])
+ subprocess.run(["xrdb", "-merge", "-nocpp", "-quiet", file])
def oomox(gen_theme):
@@ -81,8 +82,8 @@ def colors(cache_dir=CACHE_DIR):
"""Reload colors. (Deprecated)"""
sequences = os.path.join(cache_dir, "sequences")
- sys.stderr.write("'wal -r' is deprecated: "
- "Use 'cat %s' instead.\n" % sequences)
+ logging.error("'wal -r' is deprecated: "
+ "Use 'cat %s' instead.", sequences)
if os.path.isfile(sequences):
print("".join(util.read_file(sequences)), end="")