args: Repurpose -t to disable tty switching.

This commit is contained in:
Dylan Araps 2018-03-17 08:51:53 +11:00
parent da9226a8c4
commit 2e0ab26d75
2 changed files with 7 additions and 7 deletions

View File

@ -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])

View File

@ -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)