fixes #207 - save sequences file even with -s

This commit is contained in:
Amar1729 2018-03-20 20:19:27 -04:00
parent 6397473a65
commit 49922b77aa
2 changed files with 5 additions and 5 deletions

View File

@ -137,8 +137,7 @@ def process_args(args):
if not args.n: if not args.n:
wallpaper.change(colors_plain["wallpaper"]) wallpaper.change(colors_plain["wallpaper"])
if not args.s: sequences.send(colors_plain, to_send=not args.s)
sequences.send(colors_plain)
export.every(colors_plain) export.every(colors_plain)

View File

@ -73,7 +73,7 @@ def create_sequences(colors):
return "".join(sequences) 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.""" """Send colors to all open terminals."""
if OS == "Darwin": if OS == "Darwin":
tty_pattern = "/dev/ttys00[0-9]*" tty_pattern = "/dev/ttys00[0-9]*"
@ -84,6 +84,7 @@ def send(colors, cache_dir=CACHE_DIR):
sequences = create_sequences(colors) sequences = create_sequences(colors)
# Writing to "/dev/pts/[0-9] lets you send data to open terminals. # Writing to "/dev/pts/[0-9] lets you send data to open terminals.
if to_send:
for term in glob.glob(tty_pattern): for term in glob.glob(tty_pattern):
util.save_file(sequences, term) util.save_file(sequences, term)