From 55116a483429fa211566768718e4b50cb5243a46 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 21 Jun 2018 07:47:48 +1000 Subject: sequences: Fixed extra white space in iterm2 --- pywal/sequences.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index b713a6e..8566975 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -30,11 +30,9 @@ def set_color(index, color): def set_iterm_tab_color(color): """Set iTerm2 tab/window color""" - return """ - \033]6;1;bg;red;brightness;%s\a - \033]6;1;bg;green;brightness;%s\a - \033]6;1;bg;blue;brightness;%s\a - """ % (*util.hex_to_rgb(color),) + return ("\033]6;1;bg;red;brightness;%s\a" + "\033]6;1;bg;green;brightness;%s\a" + "\033]6;1;bg;blue;brightness;%s\a") % (*util.hex_to_rgb(color),) def create_sequences(colors): -- cgit v1.2.3 From 01356561c649ab90797e9d734d82f378938cb3ad Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 21 Jun 2018 08:19:01 +1000 Subject: sequences: Fix broken sequence on macOS. --- pywal/sequences.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index 8566975..cb70e93 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -22,8 +22,8 @@ def set_special(index, color, iterm_name="h", alpha=100): def set_color(index, color): """Convert a hex color to a text color sequence.""" - if OS == "Darwin": - return "\033]P%x%s\033\\" % (index, color.strip("#")) + if OS == "Darwin" and index < 20: + return "\033]P%1x%s\033\\" % (index, color.strip("#")) return "\033]4;%s;%s\033\\" % (index, color) -- cgit v1.2.3 From 842be703e1ef1011ceddbff94514d74fc2d7166b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 17 Oct 2018 15:12:33 +1100 Subject: general: fix macos issue. Closes #302 --- pywal/sequences.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index cb70e93..c691020 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -57,23 +57,24 @@ def create_sequences(colors): set_color(232, colors["special"]["background"]) ]) - # This escape sequence doesn't work in VTE terminals and their parsing of - # unknown sequences is garbage so we need to use some escape sequence - # M A G I C to hide the output. - # \033[s # Save cursor position. - # \033[1000H # Move the cursor off screen. - # \033[8m # Conceal text. - # \033]708;#000000\033\\ # Garbage sequence. - # \033[u # Restore cursor position. - sequences.extend([ - "\033[s\033[1000H\033[8m%s\033[u" % - set_special(708, colors["special"]["background"], "h", alpha), - set_special(13, colors["special"]["cursor"], "l") - ]) - if OS == "Darwin": sequences += set_iterm_tab_color(colors["special"]["background"]) + else: + # This escape sequence doesn't work in VTE terminals and their parsing of + # unknown sequences is garbage so we need to use some escape sequence + # M A G I C to hide the output. + # \033[s # Save cursor position. + # \033[1000H # Move the cursor off screen. + # \033[8m # Conceal text. + # \033]708;#000000\033\\ # Garbage sequence. + # \033[u # Restore cursor position. + sequences.extend([ + "\033[s\033[1000H\033[8m%s\033[u" % + set_special(708, colors["special"]["background"], "h", alpha), + set_special(13, colors["special"]["cursor"], "l") + ]) + return "".join(sequences) -- cgit v1.2.3 From 87944f7402a9b6680d7f2b86c769a2abed334e06 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 17 Oct 2018 15:21:25 +1100 Subject: general: remove VTE fix. --- pywal/sequences.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index c691020..0ecb840 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -60,21 +60,6 @@ def create_sequences(colors): if OS == "Darwin": sequences += set_iterm_tab_color(colors["special"]["background"]) - else: - # This escape sequence doesn't work in VTE terminals and their parsing of - # unknown sequences is garbage so we need to use some escape sequence - # M A G I C to hide the output. - # \033[s # Save cursor position. - # \033[1000H # Move the cursor off screen. - # \033[8m # Conceal text. - # \033]708;#000000\033\\ # Garbage sequence. - # \033[u # Restore cursor position. - sequences.extend([ - "\033[s\033[1000H\033[8m%s\033[u" % - set_special(708, colors["special"]["background"], "h", alpha), - set_special(13, colors["special"]["cursor"], "l") - ]) - return "".join(sequences) -- cgit v1.2.3 From 79a4069af56b26366b9ada4abf5d80e45ca78cba Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 17 Oct 2018 15:34:07 +1100 Subject: general: st cursor col --- pywal/sequences.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index 0ecb840..56c1b59 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -54,7 +54,8 @@ def create_sequences(colors): set_special(13, colors["special"]["foreground"], "l"), set_special(17, colors["special"]["foreground"], "l"), set_special(19, colors["special"]["background"], "l"), - set_color(232, colors["special"]["background"]) + set_color(232, colors["special"]["background"]), + set_color(256, colors["special"]["foreground"]) ]) if OS == "Darwin": -- cgit v1.2.3 From da0e2ff05a885422dfc61fc87ae3c68ec713751b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 24 Oct 2018 17:12:01 +1100 Subject: fix urxvt bg --- pywal/sequences.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index 56c1b59..8d92252 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -46,7 +46,7 @@ def create_sequences(colors): # Special colors. # Source: https://goo.gl/KcoQgP # 10 = foreground, 11 = background, 12 = cursor foregound - # 13 = mouse foreground + # 13 = mouse foreground, 708 = background border color. sequences.extend([ set_special(10, colors["special"]["foreground"], "g"), set_special(11, colors["special"]["background"], "h", alpha), @@ -54,6 +54,7 @@ def create_sequences(colors): set_special(13, colors["special"]["foreground"], "l"), set_special(17, colors["special"]["foreground"], "l"), set_special(19, colors["special"]["background"], "l"), + set_special(708, colors["special"]["background"], "l"), set_color(232, colors["special"]["background"]), set_color(256, colors["special"]["foreground"]) ]) -- cgit v1.2.3 From d98a551f084146d011c2374f018289ad633cd497 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 1 Nov 2018 18:03:38 +0800 Subject: Fix URxvt borders not respecting background opacity --- pywal/sequences.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index 8d92252..18aa6eb 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -54,7 +54,7 @@ def create_sequences(colors): set_special(13, colors["special"]["foreground"], "l"), set_special(17, colors["special"]["foreground"], "l"), set_special(19, colors["special"]["background"], "l"), - set_special(708, colors["special"]["background"], "l"), + set_special(708, colors["special"]["background"], "l", alpha), set_color(232, colors["special"]["background"]), set_color(256, colors["special"]["foreground"]) ]) -- cgit v1.2.3 From 614c1ab44a8527c83ba7777d2796e4d58093186a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 11 Jan 2019 07:47:02 +0200 Subject: Aargs: Added --vte to fix artifacts in VTE terminals. --- pywal/sequences.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index 18aa6eb..47acb34 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -35,7 +35,7 @@ def set_iterm_tab_color(color): "\033]6;1;bg;blue;brightness;%s\a") % (*util.hex_to_rgb(color),) -def create_sequences(colors): +def create_sequences(colors, vte_fix=False): """Create the escape sequences.""" alpha = colors["alpha"] @@ -54,18 +54,22 @@ def create_sequences(colors): set_special(13, colors["special"]["foreground"], "l"), set_special(17, colors["special"]["foreground"], "l"), set_special(19, colors["special"]["background"], "l"), - set_special(708, colors["special"]["background"], "l", alpha), set_color(232, colors["special"]["background"]), set_color(256, colors["special"]["foreground"]) ]) + if not vte_fix: + sequences.extend( + set_special(708, colors["special"]["background"], "l", alpha) + ) + if OS == "Darwin": sequences += set_iterm_tab_color(colors["special"]["background"]) return "".join(sequences) -def send(colors, cache_dir=CACHE_DIR, to_send=True): +def send(colors, cache_dir=CACHE_DIR, to_send=True, vte_fix=False): """Send colors to all open terminals.""" if OS == "Darwin": tty_pattern = "/dev/ttys00[0-9]*" @@ -73,7 +77,7 @@ def send(colors, cache_dir=CACHE_DIR, to_send=True): else: tty_pattern = "/dev/pts/[0-9]*" - sequences = create_sequences(colors) + sequences = create_sequences(colors, vte_fix) # Writing to "/dev/pts/[0-9] lets you send data to open terminals. if to_send: -- cgit v1.2.3 From 37ed6b458a892aacbc0ca372f5f01184e2cc003d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 11 Jan 2019 07:49:43 +0200 Subject: misc: make linters happy --- pywal/sequences.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index 47acb34..b42c3b7 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -60,7 +60,7 @@ def create_sequences(colors, vte_fix=False): if not vte_fix: sequences.extend( - set_special(708, colors["special"]["background"], "l", alpha) + set_special(708, colors["special"]["background"], "l", alpha) ) if OS == "Darwin": -- cgit v1.2.3 From e2cea2808c46cb85e3f5fb51b607a09addacb9bc Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 6 Mar 2019 22:19:28 -0700 Subject: Issue #382 - transparent iTerm2 cursor --- pywal/sequences.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pywal/sequences.py') diff --git a/pywal/sequences.py b/pywal/sequences.py index b42c3b7..b5028bc 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -11,7 +11,7 @@ from . import util def set_special(index, color, iterm_name="h", alpha=100): """Convert a hex color to a special sequence.""" - if OS == "Darwin": + if OS == "Darwin" and iterm_name: return "\033]P%s%s\033\\" % (iterm_name, color.strip("#")) if index in [11, 708] and alpha != "100": @@ -51,16 +51,16 @@ def create_sequences(colors, vte_fix=False): set_special(10, colors["special"]["foreground"], "g"), set_special(11, colors["special"]["background"], "h", alpha), set_special(12, colors["special"]["cursor"], "l"), - set_special(13, colors["special"]["foreground"], "l"), - set_special(17, colors["special"]["foreground"], "l"), - set_special(19, colors["special"]["background"], "l"), + set_special(13, colors["special"]["foreground"], "j"), + set_special(17, colors["special"]["foreground"], "k"), + set_special(19, colors["special"]["background"], "m"), set_color(232, colors["special"]["background"]), set_color(256, colors["special"]["foreground"]) ]) if not vte_fix: sequences.extend( - set_special(708, colors["special"]["background"], "l", alpha) + set_special(708, colors["special"]["background"], "", alpha) ) if OS == "Darwin": -- cgit v1.2.3