mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-26 07:49:17 +01:00
args: Repurpose -t to disable tty switching.
This commit is contained in:
parent
da9226a8c4
commit
2e0ab26d75
@ -70,8 +70,8 @@ def get_args(args):
|
|||||||
arg.add_argument("-s", action="store_true",
|
arg.add_argument("-s", action="store_true",
|
||||||
help="Skip changing colors in terminals.")
|
help="Skip changing colors in terminals.")
|
||||||
|
|
||||||
arg.add_argument("-t", action="store_false",
|
arg.add_argument("-t", action="store_true",
|
||||||
help="Deprecated: Does nothing and is no longer needed.")
|
help="Skip changing colors in tty.")
|
||||||
|
|
||||||
arg.add_argument("-v", action="store_true",
|
arg.add_argument("-v", action="store_true",
|
||||||
help="Print \"wal\" version.")
|
help="Print \"wal\" version.")
|
||||||
@ -143,7 +143,7 @@ def process_args(args):
|
|||||||
export.every(colors_plain)
|
export.every(colors_plain)
|
||||||
|
|
||||||
if not args.e:
|
if not args.e:
|
||||||
reload.env()
|
reload.env(tty_reload=not args.t)
|
||||||
|
|
||||||
if args.o:
|
if args.o:
|
||||||
util.disown([args.o])
|
util.disown([args.o])
|
||||||
|
@ -10,11 +10,11 @@ from .settings import CACHE_DIR, MODULE_DIR, OS
|
|||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
def tty():
|
def tty(tty_reload):
|
||||||
"""Load colors in tty."""
|
"""Load colors in tty."""
|
||||||
tty_script = os.path.join(CACHE_DIR, "colors-tty.sh")
|
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])
|
subprocess.Popen(["sh", tty_script])
|
||||||
|
|
||||||
|
|
||||||
@ -87,11 +87,11 @@ def colors(cache_dir=CACHE_DIR):
|
|||||||
print("".join(util.read_file(sequences)), end="")
|
print("".join(util.read_file(sequences)), end="")
|
||||||
|
|
||||||
|
|
||||||
def env(xrdb_file=None):
|
def env(xrdb_file=None, tty_reload=True):
|
||||||
"""Reload environment."""
|
"""Reload environment."""
|
||||||
xrdb(xrdb_file)
|
xrdb(xrdb_file)
|
||||||
i3()
|
i3()
|
||||||
sway()
|
sway()
|
||||||
polybar()
|
polybar()
|
||||||
print("reload: Reloaded environment.")
|
print("reload: Reloaded environment.")
|
||||||
tty()
|
tty(tty_reload)
|
||||||
|
Loading…
Reference in New Issue
Block a user