diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-07-22 22:26:49 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-07-22 22:26:49 +1000 |
| commit | de47c1beaaa77ee6f50235daba735ccc98ad608c (patch) | |
| tree | 03fca45aead0204d0b8619d775077f1046230ba0 /pywal/sequences.py | |
| parent | a4ea6a4f7addc3ada3c466a763331d793190a342 (diff) | |
api: Remove wal.py
Diffstat (limited to 'pywal/sequences.py')
| -rw-r--r-- | pywal/sequences.py | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/pywal/sequences.py b/pywal/sequences.py index c1a7bdd..77eace3 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -2,9 +2,9 @@ Send sequences to all open terminals. """ import os -import re -from pywal import util +from .settings import __cache_dir__ +from . import util def set_special(index, color): @@ -17,14 +17,14 @@ def set_color(index, color): return f"\033]4;{index};{color}\007" -def send_sequences(colors, vte, cache_dir): +def send(colors, vte, cache_dir=__cache_dir__): """Send colors to all open terminals.""" # Colors 0-15. sequences = [set_color(num, color) for num, color in enumerate(colors["colors"].values())] # Special colors. - # http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#XTerm_Operating_System_Commands + # Source: https://goo.gl/KcoQgP # 10 = foreground, 11 = background, 12 = cursor foregound # 13 = mouse foreground sequences.append(set_special(10, colors["special"]["foreground"])) @@ -32,7 +32,7 @@ def send_sequences(colors, vte, cache_dir): sequences.append(set_special(12, colors["special"]["cursor"])) sequences.append(set_special(13, colors["special"]["cursor"])) - # Set a blank color that isn"t affected by bold highlighting. + # Set a blank color that isn't affected by bold highlighting. # Used in wal.vim's airline theme. sequences.append(set_color(66, colors["special"]["background"])) @@ -49,19 +49,3 @@ def send_sequences(colors, vte, cache_dir): util.save_file("".join(sequences), term) print("colors: Set terminal colors") - - -def reload_colors(vte, cache_dir): - """Reload the current scheme.""" - sequence_file = cache_dir / "sequences" - - if sequence_file.is_file(): - sequences = "".join(util.read_file(sequence_file)) - - # If vte mode was used, remove the unsupported sequence. - if vte: - sequences = re.sub(r"\]708;\#.{6}", "", sequences) - - print(sequences, end="") - - exit(0) |
