mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-25 07:19:27 +01:00
reload: Remove -r
This commit is contained in:
parent
72a7713ca8
commit
57e6ef173d
@ -55,9 +55,6 @@ def get_args(args):
|
||||
help="Quiet mode, don\"t print anything and \
|
||||
don't display notifications.")
|
||||
|
||||
arg.add_argument("-r", action="store_true",
|
||||
help="Reload current colorscheme.")
|
||||
|
||||
arg.add_argument("-R", action="store_true",
|
||||
help="Restore previous colorscheme.")
|
||||
|
||||
@ -97,10 +94,6 @@ def process_args(args):
|
||||
scheme_dir = os.path.join(CACHE_DIR, "schemes")
|
||||
shutil.rmtree(scheme_dir, ignore_errors=True)
|
||||
|
||||
if args.r:
|
||||
reload.colors(args.t)
|
||||
sys.exit(0)
|
||||
|
||||
if args.a:
|
||||
util.Color.alpha_num = args.a
|
||||
|
||||
|
@ -65,17 +65,3 @@ def env(xrdb_file=None):
|
||||
sway()
|
||||
polybar()
|
||||
print("reload: Reloaded environment.")
|
||||
|
||||
|
||||
def colors(vte, cache_dir=CACHE_DIR):
|
||||
"""Reload the current scheme."""
|
||||
sequence_file = os.path.join(cache_dir, "sequences")
|
||||
|
||||
if os.path.isfile(sequence_file):
|
||||
sequences = "".join(util.read_file(sequence_file))
|
||||
|
||||
# If vte mode was used, remove the unsupported sequence.
|
||||
if vte:
|
||||
sequences = re.sub(r"\]708;(\[.{0,3}\])?\#.{6}", "", sequences)
|
||||
|
||||
print(sequences, end="")
|
||||
|
@ -45,10 +45,6 @@ def create_sequences(colors, vte):
|
||||
sequences = [set_color(index, colors["colors"]["color%s" % index])
|
||||
for index in range(16)]
|
||||
|
||||
# This escape sequence doesn"t work in VTE terminals.
|
||||
if not vte:
|
||||
sequences.append(set_special(708, colors["special"]["background"]))
|
||||
|
||||
# Special colors.
|
||||
# Source: https://goo.gl/KcoQgP
|
||||
# 10 = foreground, 11 = background, 12 = cursor foregound
|
||||
@ -61,6 +57,13 @@ def create_sequences(colors, vte):
|
||||
if OS == "Darwin":
|
||||
sequences += set_iterm_tab_color(colors["special"]["background"])
|
||||
|
||||
# Send sequences to object.
|
||||
util.Color.sequences = "".join(sequences)
|
||||
|
||||
# This escape sequence doesn"t work in VTE terminals.
|
||||
if not vte:
|
||||
sequences.append(set_special(708, colors["special"]["background"]))
|
||||
|
||||
return "".join(sequences)
|
||||
|
||||
|
||||
|
4
pywal/templates/load.sh
Normal file
4
pywal/templates/load.sh
Normal file
@ -0,0 +1,4 @@
|
||||
echo -en "{color0.sequences}"
|
||||
|
||||
[[ -z "$VTE_VERSION" ]] && \
|
||||
echo -en "\\033]708;{color0}\\007"
|
@ -10,6 +10,7 @@ import subprocess
|
||||
class Color:
|
||||
"""Color formats."""
|
||||
alpha_num = 100
|
||||
sequences = ""
|
||||
|
||||
def __init__(self, hex_color):
|
||||
self.hex_color = hex_color
|
||||
|
Loading…
Reference in New Issue
Block a user