From 2e0ab26d7542dec0657c06d431e674de01856228 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 17 Mar 2018 08:51:53 +1100 Subject: [PATCH] args: Repurpose -t to disable tty switching. --- pywal/__main__.py | 6 +++--- pywal/reload.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pywal/__main__.py b/pywal/__main__.py index 7c0bf06..cb7a750 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -70,8 +70,8 @@ def get_args(args): arg.add_argument("-s", action="store_true", help="Skip changing colors in terminals.") - arg.add_argument("-t", action="store_false", - help="Deprecated: Does nothing and is no longer needed.") + arg.add_argument("-t", action="store_true", + help="Skip changing colors in tty.") arg.add_argument("-v", action="store_true", help="Print \"wal\" version.") @@ -143,7 +143,7 @@ def process_args(args): export.every(colors_plain) if not args.e: - reload.env() + reload.env(tty_reload=not args.t) if args.o: util.disown([args.o]) diff --git a/pywal/reload.py b/pywal/reload.py index 9426cfb..e815d64 100644 --- a/pywal/reload.py +++ b/pywal/reload.py @@ -10,11 +10,11 @@ from .settings import CACHE_DIR, MODULE_DIR, OS from . import util -def tty(): +def tty(tty_reload): """Load colors in tty.""" tty_script = os.path.join(CACHE_DIR, "colors-tty.sh") - if os.path.isfile(tty_script): + if os.path.isfile(tty_script) and tty_reload: subprocess.Popen(["sh", tty_script]) @@ -87,11 +87,11 @@ def colors(cache_dir=CACHE_DIR): print("".join(util.read_file(sequences)), end="") -def env(xrdb_file=None): +def env(xrdb_file=None, tty_reload=True): """Reload environment.""" xrdb(xrdb_file) i3() sway() polybar() print("reload: Reloaded environment.") - tty() + tty(tty_reload)