Update docs of remote control commands to note that they support more image formats than just PNG

This commit is contained in:
Kovid Goyal
2024-07-17 04:38:11 +05:30
parent 065f216c6f
commit b17c2dd06b
3 changed files with 9 additions and 6 deletions

View File

@@ -82,6 +82,7 @@ PayloadGetType = PayloadGetter
ArgsType = List[str]
ImageCompletion = CompletionSpec.from_string('type:file group:"Images"')
ImageCompletion.extensions = 'png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'tiff'
SUPPORTED_IMAGE_FORMATS = tuple(x.upper() for x in ImageCompletion.extensions if x != 'jpg')
MATCH_WINDOW_OPTION = '''\

View File

@@ -11,6 +11,7 @@ from kitty.utils import is_png
from .base import (
MATCH_WINDOW_OPTION,
SUPPORTED_IMAGE_FORMATS,
ArgsType,
Boss,
CmdGenerator,
@@ -43,10 +44,10 @@ class SetBackgroundImage(RemoteCommand):
short_desc = 'Set the background image'
desc = (
'Set the background image for the specified OS windows. You must specify the path to a PNG image that'
'Set the background image for the specified OS windows. You must specify the path to an image that'
' will be used as the background. If you specify the special value :code:`none` then any existing image will'
' be removed.'
)
' be removed. Supported image formats are: '
) + ', '.join(SUPPORTED_IMAGE_FORMATS)
options_spec = f'''\
--all -a
type=bool-set

View File

@@ -11,6 +11,7 @@ from kitty.utils import is_png
from .base import (
MATCH_WINDOW_OPTION,
SUPPORTED_IMAGE_FORMATS,
ArgsType,
Boss,
CmdGenerator,
@@ -39,10 +40,10 @@ class SetWindowLogo(RemoteCommand):
short_desc = 'Set the window logo'
desc = (
'Set the logo image for the specified windows. You must specify the path to a PNG image that'
'Set the logo image for the specified windows. You must specify the path to an image that'
' will be used as the logo. If you specify the special value :code:`none` then any existing logo will'
' be removed.'
)
' be removed. Supported image formats are: '
) + ', '.join(SUPPORTED_IMAGE_FORMATS)
options_spec = MATCH_WINDOW_OPTION + '''\n
--self