Allow changing colors by mapping a keyboard shortcut to read a kitty config file with color definitions.

Fixes #2083
This commit is contained in:
Kovid Goyal
2019-10-21 14:43:35 +05:30
parent d33c287344
commit d92f8a90ef
4 changed files with 26 additions and 2 deletions

View File

@@ -1096,3 +1096,9 @@ class Boss:
msg = '\n'.join(map(format_bad_line, bad_lines)).rstrip()
self.show_error(_('Errors in kitty.conf'), msg)
def set_colors(self, *args):
from .cmds import parse_subcommand_cli, cmd_set_colors, set_colors
opts, items = parse_subcommand_cli(cmd_set_colors, ['set-colors'] + list(args))
payload = cmd_set_colors(None, opts, items)
set_colors(self, self.active_window, payload)

View File

@@ -193,6 +193,15 @@ def pipe(func, rest):
return func, rest
@func_with_args('set_colors')
def set_colors(func, rest):
import shlex
rest = shlex.split(rest)
if len(rest) < 1:
log_error('Too few arguments to set_colors function')
return func, rest
@func_with_args('nth_window')
def nth_window(func, rest):
try: