Allow changing colors by mapping a keyboard shortcut to read a kitty config file with color definitions.
Fixes #2083
This commit is contained in:
parent
d33c287344
commit
d92f8a90ef
@ -9,6 +9,10 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
|
|
||||||
- Add a new style ``powerline`` for tab bar rendering, see :opt:`tab_bar_style` (:pull:`2021`)
|
- Add a new style ``powerline`` for tab bar rendering, see :opt:`tab_bar_style` (:pull:`2021`)
|
||||||
|
|
||||||
|
- Allow changing colors by mapping a keyboard shortcut to read a kitty config
|
||||||
|
file with color definitions. See the :doc:`FAQ <faq>` for details
|
||||||
|
(:iss:`2083`)
|
||||||
|
|
||||||
- Wayland: Fix key repeat not being stopped when focus leaves window. This is
|
- Wayland: Fix key repeat not being stopped when focus leaves window. This is
|
||||||
expected behavior on Wayland, apparently (:iss:`2014`)
|
expected behavior on Wayland, apparently (:iss:`2014`)
|
||||||
|
|
||||||
|
|||||||
@ -109,8 +109,13 @@ How do I change the colors in a running kitty instance?
|
|||||||
|
|
||||||
You can either use the
|
You can either use the
|
||||||
`OSC terminal escape codes <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands>`_
|
`OSC terminal escape codes <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands>`_
|
||||||
to set colors or you can enable :doc:`remote control <remote-control>`
|
to set colors or you can define keyboard shortcuts to set colors, for example::
|
||||||
for |kitty| and use :ref:`at_set-colors`.
|
|
||||||
|
map f1 set_colors --configured /path/to/some/config/file/colors.conf
|
||||||
|
|
||||||
|
Or you can enable :doc:`remote control <remote-control>` for |kitty| and use :ref:`at_set-colors`.
|
||||||
|
The shortcut mapping technique has the same syntax as the remote control
|
||||||
|
command, for details, see :ref:`at_set-colors`.
|
||||||
|
|
||||||
A list of pre-made color themes for kitty is available at:
|
A list of pre-made color themes for kitty is available at:
|
||||||
`kitty-themes <https://github.com/dexpota/kitty-themes>`_
|
`kitty-themes <https://github.com/dexpota/kitty-themes>`_
|
||||||
|
|||||||
@ -1096,3 +1096,9 @@ class Boss:
|
|||||||
|
|
||||||
msg = '\n'.join(map(format_bad_line, bad_lines)).rstrip()
|
msg = '\n'.join(map(format_bad_line, bad_lines)).rstrip()
|
||||||
self.show_error(_('Errors in kitty.conf'), msg)
|
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
|
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')
|
@func_with_args('nth_window')
|
||||||
def nth_window(func, rest):
|
def nth_window(func, rest):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user