reload: Add back -r but write error to stderr

This commit is contained in:
Dylan Araps 2017-12-30 07:20:07 +11:00
parent 0d2c0daff0
commit 3cecd3d504
2 changed files with 13 additions and 3 deletions

View File

@ -94,9 +94,11 @@ def process_args(args):
sys.exit(0)
if args.r:
print("'wal -r' is deprecated: "
"Use 'cat ~/.cache/wal/sequences' instead.")
sys.exit(1)
sys.stderr.write("'wal -r' is deprecated: "
"Use 'cat ~/.cache/wal/sequences' instead.\n")
reload.colors()
sys.exit(0)
if args.q:
sys.stdout = sys.stderr = open(os.devnull, "w")

View File

@ -56,6 +56,14 @@ def sway():
util.disown(["swaymsg", "reload"])
def colors(cache_dir=CACHE_DIR):
"""Reload colors. (Deprecated)"""
sequences = os.path.join(cache_dir, "sequences")
if os.path.isfile(sequences):
print("".join(util.read_file(sequences)), end="")
def env(xrdb_file=None):
"""Reload environment."""
gtk()