From 49922b77aa6ed2de637cc5d55a3518601b6d6a2c Mon Sep 17 00:00:00 2001 From: Amar1729 Date: Tue, 20 Mar 2018 20:19:27 -0400 Subject: [PATCH] fixes #207 - save sequences file even with -s --- pywal/__main__.py | 3 +-- pywal/sequences.py | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pywal/__main__.py b/pywal/__main__.py index cb7a750..a47deb3 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -137,8 +137,7 @@ def process_args(args): if not args.n: wallpaper.change(colors_plain["wallpaper"]) - if not args.s: - sequences.send(colors_plain) + sequences.send(colors_plain, to_send=not args.s) export.every(colors_plain) diff --git a/pywal/sequences.py b/pywal/sequences.py index 1b2fce5..3b32af5 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -73,7 +73,7 @@ def create_sequences(colors): return "".join(sequences) -def send(colors, cache_dir=CACHE_DIR): +def send(colors, cache_dir=CACHE_DIR, to_send=True): """Send colors to all open terminals.""" if OS == "Darwin": tty_pattern = "/dev/ttys00[0-9]*" @@ -84,8 +84,9 @@ def send(colors, cache_dir=CACHE_DIR): sequences = create_sequences(colors) # Writing to "/dev/pts/[0-9] lets you send data to open terminals. - for term in glob.glob(tty_pattern): - util.save_file(sequences, term) + if to_send: + for term in glob.glob(tty_pattern): + util.save_file(sequences, term) util.save_file(sequences, os.path.join(cache_dir, "sequences")) print("colors: Set terminal colors.")