summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-03-17 08:51:53 +1100
committerDylan Araps <dylan.araps@gmail.com>2018-03-17 08:51:53 +1100
commit2e0ab26d7542dec0657c06d431e674de01856228 (patch)
treeb86bae7c8da08fedde1f18ebd9280f637a08113a
parentda9226a8c402a67bd31fc647fe888bdea3109b1f (diff)
args: Repurpose -t to disable tty switching.
-rw-r--r--pywal/__main__.py6
-rw-r--r--pywal/reload.py8
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)