Allow changing colors by mapping a keyboard shortcut to read a kitty config file with color definitions.
Fixes #2083
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user